login
A275078
Triangle read by rows in which row n lists the lexicographic composition of the elements of symmetric group S_n.
0
1, 2, 1, 2, 1, 3, 3, 4, 1, 2, 2, 4, 1, 5, 3, 5, 4, 2, 6, 1, 3, 4, 7, 5, 1, 3, 2, 6, 8, 1, 2, 3, 4, 7, 6, 5, 6, 9, 2, 1, 7, 8, 5, 4, 3, 2, 8, 9, 4, 6, 7, 10, 5, 1, 3, 5, 1, 6, 10, 8, 11, 9, 2, 7, 3, 4, 7, 1, 9, 5, 6, 2, 12, 4, 8, 11, 10, 3
OFFSET
1,2
EXAMPLE
Triangle begins:
1
2 1
2 1 3
3 4 1 2
2 4 1 5 3
5 4 2 6 1 3
4 7 5 1 3 2 6
8 1 2 3 4 7 6 5
6 9 2 1 7 8 5 4 3
2 8 9 4 6 7 10 5 1 3
5 1 6 10 8 11 9 2 7 3 4
7 1 9 5 6 2 12 4 8 11 10 3
For the third row, the 6 permutations of 123 in lexical order are 123, 132, 213, 231, 312, and 321. Consecutively applying each permutation to 123 results in the sequence: 123, 132, 312, 123, 312, 213. The final element with commas inserted gives us the row: 2,1,3.
PROG
(Python)
from itertools import count, permutations
for size in count(1):
row = tuple(range(1, size + 1))
for p in permutations(range(size)):
row = tuple(row[i] for i in p)
print(row)
CROSSREFS
Sequence in context: A213237 A029334 A375825 * A286478 A340756 A030273
KEYWORD
nonn,tabl
AUTHOR
David Nickerson, Jul 15 2016
STATUS
approved