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.

Showing 1-4 of 4 results.

A026791 Triangle in which n-th row lists juxtaposed lexicographically ordered partitions of n; e.g., the partitions of 3 (1+1+1,1+2,3) appear as 1,1,1,1,2,3 in row 3.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 2, 2, 1, 4, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 4, 1, 2, 3, 1, 5, 2, 2, 2, 2, 4, 3, 3, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 4, 1, 1, 2, 3, 1, 1, 5
Offset: 1

Views

Author

Keywords

Comments

Differs from A080576 in a(18): Here, (...,1+3,2+2,4), there (...,2+2,1+3,4).
The representation of the partitions (for fixed n) is as (weakly) increasing lists of parts, the order between individual partitions (for the same n) is lexicographic (see example). - Joerg Arndt, Sep 03 2013
The equivalent sequence for compositions (ordered partitions) is A228369. - Omar E. Pol, Oct 19 2019

Examples

			First six rows are:
[[1]];
[[1, 1], [2]];
[[1, 1, 1], [1, 2], [3]];
[[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2], [4]];
[[1, 1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 3], [1, 2, 2], [1, 4], [2, 3], [5]];
[[1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 2], [1, 1, 1, 3], [1, 1, 2, 2], [1, 1, 4], [1, 2, 3], [1, 5], [2, 2, 2], [2, 4], [3, 3], [6]];
...
From _Omar E. Pol_, Sep 03 2013: (Start)
Illustration of initial terms:
----------------------------------
.                     Ordered
n  j      Diagram     partition j
----------------------------------
.               _
1  1           |_|    1;
.             _ _
2  1         | |_|    1, 1,
2  2         |_ _|    2;
.           _ _ _
3  1       | | |_|    1, 1, 1,
3  2       | |_ _|    1, 2,
3  3       |_ _ _|    3;
.         _ _ _ _
4  1     | | | |_|    1, 1, 1, 1,
4  2     | | |_ _|    1, 1, 2,
4  3     | |_ _ _|    1, 3,
4  4     |   |_ _|    2, 2,
4  5     |_ _ _ _|    4;
...
(End)
		

Crossrefs

Row lengths are given in A006128.
Partition lengths are in A193173.
Row lengths are A000041.
Partition sums are A036042.
Partition minima are A196931.
Partition maxima are A194546.
The reflected version is A211992.
The length-sensitive version (sum/length/lex) is A036036.
The colexicographic version (sum/colex) is A080576.
The version for non-reversed partitions is A193073.
Compositions under the same ordering (sum/lex) are A228369.
The reverse-lexicographic version (sum/revlex) is A228531.
The Heinz numbers of these partitions are A334437.

Programs

  • Maple
    T:= proc(n) local b, ll;
          b:= proc(n,l)
                if n=0 then ll:= ll, l[]
              else seq(b(n-i, [l[], i]), i=`if`(l=[],1,l[-1])..n)
                fi
              end;
          ll:= NULL; b(n, []); ll
        end:
    seq(T(n), n=1..8);  # Alois P. Heinz, Jul 16 2011
  • Mathematica
    T[n0_] := Module[{b, ll}, b[n_, l_] := If[n == 0, ll = Join[ll, l], Table[ b[n - i, Append[l, i]], {i, If[l == {}, 1, l[[-1]]], n}]]; ll = {}; b[n0, {}]; ll]; Table[T[n], {n, 1, 8}] // Flatten (* Jean-François Alcover, Aug 05 2015, after Alois P. Heinz *)
    Table[DeleteCases[Sort@PadRight[Reverse /@ IntegerPartitions[n]], x_ /; x == 0, 2], {n, 7}] // Flatten (* Robert Price, May 18 2020 *)
  • Python
    t = [[[]]]
    for n in range(1, 10):
        p = []
        for minp in range(1, n):
            p += [[minp] + pp for pp in t[n-minp] if min(pp) >= minp]
        t.append(p + [[n]])
    print(t)
    # Andrey Zabolotskiy, Oct 18 2019

A242628 Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 1, 1, 4, 3, 3, 3, 2, 2, 2, 2, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 5, 4, 4, 4, 3, 3, 3, 3, 4, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 4, 1, 3, 3, 1, 3, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 5, 5, 4, 4, 4, 4, 5, 3, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 5, 2
Offset: 1

Views

Author

Keywords

Comments

This can be calculated using the binary expansion of n; see the PARI program.
The n-th row consists of all partitions with hook size (maximum + number of parts - 1) equal to n.
The partitions in row n of this sequence are the conjugates of the partitions in row n of A125106 taken in reverse order.
Row n is also the reversed partial sums plus one of the n-th composition in standard order (A066099) minus one. - Gus Wiseman, Nov 07 2022

Examples

			The table starts:
  1;
  2; 1,1;
  3; 2,2; 2,1; 1,1,1;
  4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
  ...
		

Crossrefs

Cf. A241596 (another version of this list of partitions), A125106, A240837, A112531, A241597 (compositions).
For other schemes to list integer partitions, please see for example A227739, A112798, A241918, A114994.
First element in each row is A008687.
Last element in each row is A065120.
Heinz numbers of rows are A253565.
Another version is A358134.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> x[], b(n))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    T[1] = {{1}};
    T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
    Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
  • PARI
    apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.

A241596 Partitions listed by alternately incrementing each part and appending a 1.

Original entry on oeis.org

1, 2, 11, 3, 22, 21, 111, 4, 33, 32, 222, 31, 221, 211, 1111, 5, 44, 43, 333, 42, 332, 322, 2222, 41, 331, 321, 2221, 311, 2211, 2111, 11111, 6, 55, 54, 444, 53, 443, 433, 3333, 52, 442, 432, 3332, 422, 3322, 3222, 22222, 51, 441, 431, 3331, 421, 3321, 3221, 22221, 411, 3311, 3211, 22211, 3111, 22111, 21111, 111111
Offset: 1

Views

Author

N. J. A. Sloane, May 19 2014

Keywords

Comments

Start with S_0 = {1}.
Thereafter, S_{n+1} consists of the partitions in S_n with all parts incremented by 1, together with all partitions in S_n with an additional part of 1.
From Franklin T. Adams-Watters, May 19 2014:
a(n) can be defined in terms of the binary expansion of n. Start with the partition [1]. Now process the bits of n from right to left, excluding the leading 1. For a zero bit, increase each number in the partition by 1; for a one bit, add a part of size 1. For example, for n=11, binary 1011, we get 1 -> 11 -> 111 -> 222 = a(11).
Row n consists of all partitions with hook size (maximum part + number of parts - 1) equal to n.
This sequence will eventually fail because digits greater than 9 are needed.

Examples

			The partitions appear in the following order:
S_0 = 1,
S_1 = 2, 11,
S_2 = 3, 22, 21, 111,
S_3 = 4, 33, 32, 222, 31, 221, 211, 1111,
S_4 = 5, 44, 43, 333, 42, 332, 322, 2222, 41, 331, 321, 2221, 311, 2211, 2111, 11111,
...
		

References

  • Arie Groeneveld, Posting to Sequence Fans List, May 19 2014

Crossrefs

See A242628 for another version of this list of partitions.
Cf. A125106, A240837, A112531, A241597 (compositions).

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> parse(cat(x[])), b(n))[]:
    seq(T(n), n=1..6);

Extensions

Typos corrected by Alois P. Heinz, Sep 25 2015

A240750 Table where row n contains all compositions of n into an even number of parts.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 2, 2, 1, 3, 1, 1, 1, 1, 4, 1, 3, 2, 2, 3, 2, 1, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 5, 1, 4, 2, 3, 3, 3, 1, 1, 1, 2, 4, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 5, 1, 3, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1
Offset: 2

Views

Author

Keywords

Comments

Can also be regarded as a table where row n is the n-th composition into an even number of parts, sorted by sum of composition and then reverse lexicographically.

Examples

			The table starts:
{}
(none)
11
21,12
31,22,13,1111
41,32,23,2111,14,1211,1121,1112
51,42,33,3111,24,2211,2121,2112,15,1311,1221,1212,1131,1122,1113,111111
		

Crossrefs

Cf. A066099, A240837, A001969, A034008 (compositions in rows), A087447 (parts in rows for n>2).

Programs

  • PARI
    evil(n) = local(r=0,m=n);while(m>0,if(m%2==1,r=1-r);m\=2);n*2+r
    A066099row(n) = {local(v=vector(n), j=0, k=0);
       while(n>0, k++; if(n%2==1, v[j++]=k; k=0); n\=2);
       vector(j, i, v[j-i+1])}
    arow(n)=A066099row(evil(n))
Showing 1-4 of 4 results.