From composer Grant Harville comes a musical mystery:
Grant is writing a musical composition. At one point in the piece, there’s an improvisational passage where musicians are instructed to repeatedly play a sequence of eight notes, which we can label as 1 through 8. The shortest such sequence is 12345678.
However, musicians can also revert to previous notes, replaying certain subsequences for additional flair. More specifically:
That’s a whole bunch of rules! To make this clearer, it may be helpful to see some examples. The following are examples of valid sequences:
Meanwhile, here are examples of invalid sequences, for various reasons:
How many different sequences of the eight notes are possible under these conditions?
I wrote code:
I collected all sequences from C and iii for 1 to 10 notes.
Some subtle differences in the sequences.
123456-23678 is an invalid sequence, but 123456-23-678 is valid.
123456-2345678, 123456-234-5678, 123456-23-45-678 are different sequences using reversions, but the same by note sequence.
817 sequences for 8 notes if defined by note order.
1939 sequences for 8 notes if defined by reversions.