Generating a conditional sequence number