I want to generate a special 12-tone row starting with zero, with the remaining 11 columns being allowed any number from 1-11. I'll call this the original row.
So rule one is every number must be unique and the first number must be zero.
Here is one example. 0, 2, 7, 5, 8, 9, 3, 12, 4, 11, 10, 6
The second rule is the secondary row that is produced from the difference between two consecutive numbers in the first row must also be unique. To calculate this new row you use a modulus =MOD(col2-col1,12). So this will give you 11 columns. In this case it produced a rank without repetition.
2, 5, 10, 3, 1, 6, 9, 4, 7, 11, 8
How many of these numbers exist which fulfil this property? I have experimented in Excel to randomly generate around 20,000 rows at a time, and I get roughly one new match every 10 or 20 re-calculates. It's not optimised for generating the first zero automatically, but that would presumably mean 10*20,000/12 - 20*20,000/12 rows are needed to randomly get a row that matches rule one and rule two.
What I have noticed so far is that all rows that match this property also has the last column as 6.
Finally, I want to know if I generate a third row in the same way in which I calculate the secondary row using the difference of the modulus 12 of the secondary row. What this means is you will have 10 columns from this in this tertiary row.
I have tried randomly generating perhaps 5000 * 20,000 rows and haven't found a match.
What are the mathematics that describes how many of these secondary or tertiary rows exist which are unique?
If you want to read a little bit more about where this idea comes from, it is my concept of a restriction based on the 12 tone row in music, invented by Arnold Schoenberg.
https://unitus.org/FULL/12tone.pdf
Let's invert the question. We start off with the unique first difference, which is just a permutation of the numbers 1 through 11.
So let's say $p$ is such a permutation. Then we want to make sure that $(\sum_{k=1}^n p_k)\bmod 12$ is unique for all $n$ (note that this sum gives the $n$th number in the original sequence, counting from zero). This allows us to easily enumerate all possible permutations, skipping entire portions of the problem when the prefix of a permutation already leads to duplicates. In Python:
This gives us our desired result, there are $3856$ of these objects.
If your also want the second differences to be unique modulo 12, only 8 results remain: