A212958 Array with a variable number of columns, where terms in the n-th row are the differences (computed in decimal base and divided by 9) between equal ratio permutations, found in the base n>=2, and the first (in ascending order of digits) minimal value permutation of {0,1,...,n}.
0, 0, 1, 1, 0, 1, 12, 22, 0, 21, 22, 123, 131, 343, 0, 342, 343, 1234, 2531, 4664, 0, 1421, 3242, 4663, 12345, 58985, 0, 58984, 58985, 23456, 497531, 713306, 0, 137421, 276842, 436463, 575884, 713305, 713306, 1234567, 1810675, 2907844, 4002993, 6197531, 8367727
Offset: 1
Examples
For the fourth (n=4) row, which relates to base-4 four-digit {0, 1, 2, 3} distinct permutations, there are A039649(p) pairs where p = n-1 and thus for n=4, p=3, A039649(3)=3 - so there are three pairs in the fourth row. Those pairs are supposed to have the same ratio, which can be calculated using the expression A221740(p)/A221741(p) = (p^2*(p+1)^p - (p+1)^p+1)/(-p^2 + p*(p+1)^p + (p+1)^p - p - 1), which for n=4 (p = n-1 = 3) yields 19/9 = 2.111. The exhaustive computer program featured in the link finds that in decimal notation those three pairs with the ratio 19/9 = 2.111... are: (1) {114,54}; (2) {57,27}; (3) {228,108} In base-4 notation, those 3 pairs of distinct permutations are: (1) {1302, 0312}; (2) {0321,0123}; (3) {3210,1230}; Now we calculate the fourth row terms per the sequence's definition: (1302-0123)/9 = 131; (0312-0123)/9 = 21; (0321-0123)/9 = 22; (0123-0123)/9 = 0; (3210-0123)/9 = 343; (1230-0123)/9 = 123; Thus, for the fourth row (n=4), which corresponds to base 4 (note that rows in the table are counted starting with n=2, which corresponds to base 2) we get the following 6 (three pairs) sequence terms, presented as sorted in ascending order: 0, 21, 22, 123, 131, 343, ...
Links
- R. J. Cano, PARI/GP program - detection script for finding the equal ratio permutation pairs for each base in the range from 2 to 10
- A. Povolotsky, Number of specific permutations pairs relates to Euler Phi totient function ?, NMBRTHRYY 27 Jan 2013
- StackExchange, Permutations (with no duplicates) of decimal base digits 1,2,...,8,9,0.
Comments