Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Oct 29 2020 02:42:10
%S 1,1,1,1,2,1,1,1,1,1,2,1,2,1,1,2,3,1,1,1,1,1,1,1,2,1,1,2,1,1,1,2,2,1,
%T 1,2,3,1,2,1,1,1,2,1,2,1,2,1,3,1,2,3,1,1,2,3,4,1,1,1,1,1,1,1,1,1,2,1,
%U 1,1,2,1,1,1,1,2,2,1,1,1,2,3,1,1,2,1,1
%N Irregular triangle read by rows enumerating nonempty finite ballot sequences by increasing length and then by lexicographical order.
%C Ballot sequences B have positive terms, and for any finite prefix P of B and any k > 0, the number of occurrences of k in P is greater than or equal to the number of occurrences of k+1 in P.
%C Shuffling two ballot sequences gives another ballot sequence.
%C The ordinal transform of a ballot sequence is also a ballot sequence.
%C The ordinal transform restricted to the set of ballot sequences is a self-inverse permutation.
%C For any n > 0:
%C - there are A000085(n) rows with n terms,
%C - the first row with n terms has only 1's,
%C - the last row with n terms equals [1, 2, ..., n].
%H Rémy Sigrist, <a href="/A338411/b338411.txt">Table of n, a(n) for n = 1..8379</a>
%H OEIS Wiki, <a href="/wiki/Ordinal_transform">Ordinal transform</a>
%H Rémy Sigrist, <a href="/A338411/a338411.gp.txt">PARI program for A338411</a>
%e Table begins:
%e 1: [1]
%e 2: [1, 1]
%e 3: [1, 2]
%e 4: [1, 1, 1]
%e 5: [1, 1, 2]
%e 6: [1, 2, 1]
%e 7: [1, 2, 3]
%e 8: [1, 1, 1, 1]
%e 9: [1, 1, 1, 2]
%e 10: [1, 1, 2, 1]
%e 11: [1, 1, 2, 2]
%e 12: [1, 1, 2, 3]
%e 13: [1, 2, 1, 1]
%e 14: [1, 2, 1, 2]
%e 15: [1, 2, 1, 3]
%e 16: [1, 2, 3, 1]
%e 17: [1, 2, 3, 4]
%o (PARI) See Links section.
%Y Cf. A000085.
%K nonn,tabf
%O 1,5
%A _Rémy Sigrist_, Oct 25 2020