cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A228525 Triangle read by rows in which row n lists the compositions (ordered partitions) of n in colexicographic order.

This page as a plain text file.
%I A228525 #63 Sep 14 2013 12:46:36
%S A228525 1,1,1,2,1,1,1,2,1,1,2,3,1,1,1,1,2,1,1,1,2,1,3,1,1,1,2,2,2,1,3,4,1,1,
%T A228525 1,1,1,2,1,1,1,1,2,1,1,3,1,1,1,1,2,1,2,2,1,1,3,1,4,1,1,1,1,2,2,1,2,1,
%U A228525 2,2,3,2,1,1,3,2,3,1,4,5,1,1,1,1,1,1
%N A228525 Triangle read by rows in which row n lists the compositions (ordered partitions) of n in colexicographic order.
%C A228525 The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is co-lexicographic. [_Joerg Arndt_, Sep 02 2013]
%C A228525 The equivalent sequence for partitions is A211992.
%C A228525 Row n has length A001792(n-1).
%C A228525 Row sums give A001787, n >= 1.
%H A228525 Joerg Arndt, <a href="/A228525/b228525.txt">Table of n, a(n) for n = 1..10000</a>
%e A228525 Illustration of initial terms:
%e A228525 ---------------------------------
%e A228525 n  j     Diagram     Composition
%e A228525 ---------------------------------
%e A228525 .         _
%e A228525 1  1     |_|         1;
%e A228525 .         _ _
%e A228525 2  1     |_| |       1, 1,
%e A228525 2  2     |_ _|       2;
%e A228525 .         _ _ _
%e A228525 3  1     |_| | |     1, 1, 1,
%e A228525 3  2     |_ _| |     2, 1,
%e A228525 3  3     |_|   |     1, 2,
%e A228525 3  4     |_ _ _|     3;
%e A228525 .         _ _ _ _
%e A228525 4  1     |_| | | |   1, 1, 1, 1,
%e A228525 4  2     |_ _| | |   2, 1, 1,
%e A228525 4  3     |_|   | |   1, 2, 1,
%e A228525 4  4     |_ _ _| |   3, 1,
%e A228525 4  5     |_| |   |   1, 1, 2,
%e A228525 4  6     |_ _|   |   2, 2,
%e A228525 4  7     |_|     |   1, 3,
%e A228525 4  8     |_ _ _ _|   4;
%e A228525 .
%e A228525 Triangle begins:
%e A228525 [1];
%e A228525 [1,1],[2];
%e A228525 [1,1,1],[2,1],[1,2],[3];
%e A228525 [1,1,1,1],[2,1,1],[1,2,1],[3,1],[1,1,2],[2,2],[1,3],[4];
%e A228525 [1,1,1,1,1],[2,1,1,1],[1,2,1,1],[3,1,1],[1,1,2,1],[2,2,1],[1,3,1],[4,1],[1,1,1,2],[2,1,2],[1,2,2],[3,2],[1,1,3],[2,3],[1,4],[5];
%o A228525 (PARI)
%o A228525 gen_comp(n)=
%o A228525 {  /* Generate compositions of n as lists of parts (order is lex): */
%o A228525     my(ct = 0);
%o A228525     my(m, z, pt);
%o A228525     \\ init:
%o A228525     my( a = vector(n, j, 1) );
%o A228525     m = n;
%o A228525     while ( 1,
%o A228525         ct += 1;
%o A228525         pt = vector(m, j, a[j]);
%o A228525 \\        /* for A228369  print composition: */
%o A228525 \\        for (j=1, m, print1(pt[j],", ") );
%o A228525         /* for A228525 print reversed (order is colex): */
%o A228525         forstep (j=m, 1, -1, print1(pt[j],", ") );
%o A228525         if ( m<=1,  return(ct) );  \\ current is last
%o A228525         a[m-1] += 1;
%o A228525         z = a[m] - 2;
%o A228525         a[m] = 1;
%o A228525         m += z;
%o A228525     );
%o A228525     return(ct);
%o A228525 }
%o A228525 for(n=1, 12, gen_comp(n) );
%o A228525 \\ _Joerg Arndt_, Sep 02 2013
%Y A228525 Cf. A066099, A211992, A228351, A228369.
%K A228525 nonn,tabf
%O A228525 1,4
%A A228525 _Omar E. Pol_, Aug 24 2013