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-8 of 8 results.

A322762 Irregular triangle read by rows: to get row n, take partitions of n ordered as in A080577, and in each partition, change each j-th occurrence of k to j; use compressed notation as in A322761.

Original entry on oeis.org

1, 1, 12, 1, 11, 123, 1, 11, 12, 112, 1234, 1, 11, 11, 112, 121, 1123, 12345, 1, 11, 11, 112, 12, 111, 1123, 123, 1212, 11234, 123456, 1, 11, 11, 112, 11, 111, 1123, 121, 112, 1112, 11234, 1231, 12123, 112345, 1234567, 1, 11, 11, 112, 11, 111, 1123, 12, 111
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2018

Keywords

Examples

			Triangle begins:
  1,
  1, 12,
  1, 11, 123,
  1, 11, 12, 112, 1234,
  1, 11, 11, 112, 121, 1123, 12345,
  1, 11, 11, 112, 12, 111, 1123, 123, 1212, 11234, 123456,
  ...
For example, the 11 partitions of 6 are:
6, 51, 42, 411, 33, 321, 3111, 222, 2211, 21111, 111111,
and applying the transformation we get:
1, 11, 11, 112, 12, 111, 1123, 123, 1212, 11234, 123456.
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.2.1.5, Problem 73, pp. 415, 761.

Crossrefs

Programs

  • Maple
    b:= (n, i)-> `if`(n=0 or i=1, [cat($1..n)], [(t->
        seq(map(x-> cat($1..(t+1-j), x), b(n-i*(t+1-j)
        , i-1))[], j=1..t))(iquo(n, i)), b(n, i-1)[]]):
    T:= n-> map(parse, b(n$2))[]:
    seq(T(n), n=1..10);  # Alois P. Heinz, Dec 30 2018

Extensions

More terms from Alois P. Heinz, Dec 30 2018

A080577 Triangle in which n-th row lists all partitions of n, in graded reverse lexicographic ordering.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

This is the "Mathematica" ordering of the partitions, referenced in numerous other sequences. The partitions of each integer are in reverse order of the conjugates of the partitions in Abramowitz and Stegun order (A036036). They are in the reverse of the order of the partitions in Maple order (A080576). - Franklin T. Adams-Watters, Oct 18 2006
The graded reverse lexicographic ordering of the partitions is often referred to as the "Canonical" ordering of the partitions. - Daniel Forgues, Jan 21 2011
Also the "MAGMA" ordering of the partitions. - Jason Kimberley, Oct 28 2011
Also an intuitive ordering described but not formalized in [Hardy and Wright] the first four editions of which precede [Abramowitz and Stegun]. - L. Edson Jeffery, Aug 03 2013
Also the "Sage" ordering of the partitions. - Peter Luschny, Aug 12 2013
While this is the order used for the constructive function "IntegerPartitions", it is different from Mathematica's canonical ordering of finite expressions, the latter giving A036036 if parts of partitions are read in reversed (weakly increasing) order, or A334301 if in the usual (weakly decreasing) order. - Gus Wiseman, May 08 2020

Examples

			First five rows are:
  {{1}}
  {{2}, {1, 1}}
  {{3}, {2, 1}, {1, 1, 1}}
  {{4}, {3, 1}, {2, 2}, {2, 1, 1}, {1, 1, 1, 1}}
  {{5}, {4, 1}, {3, 2}, {3, 1, 1}, {2, 2, 1}, {2, 1, 1, 1}, {1, 1, 1, 1, 1}}
Up to the fifth row, this is exactly the same as the colexicographic ordering A036037. The first row which differs is the sixth one, which reads ((6), (5,1), (4,2), (4,1,1), (3,3), (3,2,1), (3,1,1,1), (2,2,2), (2,2,1,1), (2,1,1,1,1), (1,1,1,1,1,1)). - _M. F. Hasler_, Jan 23 2020
From _Gus Wiseman_, May 08 2020: (Start)
The sequence of all partitions begins:
  ()         (3,2)        (2,1,1,1,1)    (2,2,1,1,1)
  (1)        (3,1,1)      (1,1,1,1,1,1)  (2,1,1,1,1,1)
  (2)        (2,2,1)      (7)            (1,1,1,1,1,1,1)
  (1,1)      (2,1,1,1)    (6,1)          (8)
  (3)        (1,1,1,1,1)  (5,2)          (7,1)
  (2,1)      (6)          (5,1,1)        (6,2)
  (1,1,1)    (5,1)        (4,3)          (6,1,1)
  (4)        (4,2)        (4,2,1)        (5,3)
  (3,1)      (4,1,1)      (4,1,1,1)      (5,2,1)
  (2,2)      (3,3)        (3,3,1)        (5,1,1,1)
  (2,1,1)    (3,2,1)      (3,2,2)        (4,4)
  (1,1,1,1)  (3,1,1,1)    (3,2,1,1)      (4,3,1)
  (5)        (2,2,2)      (3,1,1,1,1)    (4,2,2)
  (4,1)      (2,2,1,1)    (2,2,2,1)      (4,2,1,1)
The triangle with partitions shown as Heinz numbers (A129129) begins:
   1
   2
   3   4
   5   6   8
   7  10   9  12  16
  11  14  15  20  18  24  32
  13  22  21  28  25  30  40  27  36  48  64
  17  26  33  44  35  42  56  50  45  60  80  54  72  96 128
(End)
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Clarendon Press, Oxford, Fifth edition, 1979, p. 273.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 287.

Crossrefs

See A080576 Maple (graded reflected lexicographic) ordering.
See A036036 for the Hindenburg (graded reflected colexicographic) ordering (listed in the Abramowitz and Stegun Handbook).
See A036037 for graded colexicographic ordering.
See A228100 for the Fenner-Loizou (binary tree) ordering.
Differs from A036037 at a(48).
See A322761 for a compressed version.
Lexicographically ordered reversed partitions are A026791.
Reverse-colexicographically ordered partitions are A026792.
Compositions under this ordering are A066099.
Distinct parts of these partitions are counted by A115623.
Taking Heinz numbers gives A129129.
Lexicographically ordered partitions are A193073.
Colexicographically ordered partitions are A211992.
Reading partitions in reverse (weakly increasing) order gives A228531.
Lengths of these partitions are A238966.
Sorting partitions by Heinz number gives A296150.
The maxima of these partitions are A331581.
The length-sensitive version is A334439.

Programs

  • Magma
    &cat[&cat Partitions(n):n in[1..7]]; // Jason Kimberley, Oct 28 2011
    
  • Maple
    b:= (n, i)-> `if`(n=0 or i=1, [[1$n]], [map(x->
        [i, x[]], b(n-i, min(n-i, i)))[], b(n, i-1)[]]):
    T:= n-> map(x-> x[], b(n$2))[]:
    seq(T(n), n=1..8);  # Alois P. Heinz, Jan 29 2020
  • Mathematica
    <Jean-François Alcover, Dec 10 2012 *)
    revlexsort[f_,c_]:=OrderedQ[PadRight[{c,f}]];
    Join@@Table[Sort[IntegerPartitions[n],revlexsort],{n,0,8}] (* Gus Wiseman, May 08 2020 *)
  • PARI
    A080577_row(n)={vecsort(apply(t->Vecrev(t),partitions(n)),,4)} \\ M. F. Hasler, Jan 21 2020
  • Sage
    L = []
    for n in range(8): L += list(Partitions(n))
    flatten(L)   # Peter Luschny, Aug 12 2013
    

A332706 Index position of {2}^n within the list of partitions of 2n in canonical ordering.

Original entry on oeis.org

1, 1, 3, 8, 18, 37, 71, 128, 223, 376, 617, 991, 1563, 2423, 3704, 5589, 8333, 12293, 17959, 25996, 37318, 53153, 75153, 105535, 147249, 204201, 281563, 386128, 526795, 715191, 966437, 1300125, 1741598, 2323487, 3087701, 4087933, 5392747, 7089463, 9289053
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2020

Keywords

Comments

The canonical ordering of partitions is described in A080577.

Examples

			a(3) = 8, because 222 has position 8 within the list of partitions of 6 in canonical ordering: 6, 51, 42, 411, 33, 321, 3111, 222, ... .
		

Crossrefs

Bisection (even part) of A058984.

Programs

  • Maple
    a:= n-> combinat[numbpart](2*n)-n:
    seq(a(n), n=0..44);
  • Mathematica
    a[n_] := PartitionsP[2n] - n;
    Table[a[n], {n, 0, 44}] (* Jean-François Alcover, Aug 20 2021, from Maple *)

Formula

a(n) = A000041(2n) - n.
a(n) = A058984(2n).
a(n) = A330661(2n,n).

A322763 Irregular triangle read by rows: to get row n, take partitions of n ordered as in A080577, and in each partition, change each j-th occurrence of k to j; use uncompressed notation as in A080577.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 30 2018

Keywords

Comments

The compressed form seems easier to understand. This is A322762 but with each partition, after it has been transformed, written as the string of its parts.

Examples

			In compressed form (see A322762) triangle begins:
  1,
  1, 12,
  1, 11, 123,
  1, 11, 12, 112, 1234,
  1, 11, 11, 112, 121, 1123, 12345,
  1, 11, 11, 112, 12, 111, 1123, 123, 1212, 11234, 123456,
  ...
For example, the 11 partitions of 6 are:
6, 51, 42, 411, 33, 321, 3111, 222, 2211, 21111, 111111,
and applying the transformation we get:
1, 11, 11, 112, 12, 111, 1123, 123, 1212, 11234, 123456.
In the uncompressed notation the triangle begins:
  {1},
  {1}, {1,2},
  {1}, {1,1}, {1,2,3},
  {1}, {1,1}, {1,2}, {1,1,2}, {1,2,3,4},
  {1}, {1,1}, {1,1}, {1,1,2}, {1,2,1}, {1,1,2,3}, {1,2,3,4,5},
  ...
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.2.1.5, Problem 73, pp. 415, 761.

Crossrefs

Programs

  • Maple
    b:= (n, i)-> `if`(n=0 or i=1, [[$1..n]], [(t->
        seq(map(x-> [$1..(t+1-j), x[]], b(n-i*(t+1-j)
        , i-1))[], j=1..t))(iquo(n, i)), b(n, i-1)[]]):
    T:= n-> map(x-> x[], b(n$2))[]:
    seq(T(n), n=1..10);  # Alois P. Heinz, Dec 30 2018

Extensions

More terms from Alois P. Heinz, Dec 30 2018

A332719 Index position of {n}^3 within the list of partitions of 3n in canonical ordering.

Original entry on oeis.org

1, 3, 8, 19, 44, 93, 187, 357, 657, 1166, 2015, 3393, 5594, 9044, 14378, 22501, 34734, 52931, 79735, 118823, 175337, 256347, 371606, 534377, 762721, 1080979, 1521925, 2129330, 2961580, 4096006, 5634855, 7712558, 10505457, 14243772, 19227383, 25845241, 34600673
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2020

Keywords

Comments

The canonical ordering of partitions is described in A080577.

Examples

			a(2) = 8, because 222 has position 8 within the list of partitions of 6 in canonical ordering: 6, 51, 42, 411, 33, 321, 3111, 222, ... .
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember;
         `if`(n=0, 1, b(n-i, i)+g(n, i-1))
        end:
    g:= proc(n, i) option remember; `if`(n=0 or i=1, 1,
         `if`(i<1, 0, g(n-i, min(n-i, i))+g(n, i-1)))
        end:
    a:= n-> g(3*n$2)-b(3*n, n)+1:
    seq(a(n), n=0..37);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, b[n - i, i] + g[n, i - 1]];
    g[n_, i_] := g[n, i] = If[n == 0 || i == 1, 1, If[i < 1, 0, g[n - i, Min[n - i, i]] + g[n, i - 1]]];
    a[n_] := g[3n, 3n] - b[3n, n] + 1;
    a /@ Range[0, 37] (* Jean-François Alcover, Jan 06 2021, after Alois P. Heinz *)

Formula

a(n) ~ exp(2*Pi*sqrt(n/3)) / (4*Pi*sqrt(n)). - Vaclav Kotesovec, Feb 28 2020

A332720 Index position of {3}^n within the list of partitions of 3n in canonical ordering.

Original entry on oeis.org

1, 1, 5, 19, 59, 150, 349, 745, 1515, 2936, 5514, 10036, 17851, 31039, 53006, 88943, 147057, 239701, 385885, 613855, 966137, 1505137, 2323124, 3553914, 5392315, 8117758, 12131618, 18003740, 26543030, 38886999, 56633453, 82009410, 118113488, 169229009, 241264461
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2020

Keywords

Comments

The canonical ordering of partitions is described in A080577.

Examples

			a(2) = 5, because 33 has position 5 within the list of partitions of 6 in canonical ordering: 6, 51, 42, 411, 33, 321, 3111, 222, ... .
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
         `if`(n=0, 1, b(n-1)+g(3*n, 2))
        end:
    g:= proc(n, i) option remember; `if`(n=0 or i=1, 1,
         `if`(i<1, 0, g(n-i, min(n-i, i))+g(n, i-1)))
        end:
    a:= n-> g(3*n$2)-b(n)+1:
    seq(a(n), n=0..35);
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, b[n - 1] + g[3n, 2]];
    g[n_, i_] := g[n, i] = If[n == 0 || i == 1, 1, If[i < 1, 0, g[n - i, Min[n - i, i]] + g[n, i - 1]]];
    a[n_] := g[3n, 3n] - b[n] + 1;
    a /@ Range[0, 35] (* Jean-François Alcover, Jan 06 2021, after Alois P. Heinz *)

Formula

a(n) ~ exp(Pi*sqrt(2*n)) / (4*3^(3/2)*n). - Vaclav Kotesovec, Feb 28 2020

A332567 T(n,k) is the k-th partition of n in graded reverse lexicographic ordering (A080577) encoded as concatenation of parts which are represented in (zeroless) bijective base-9 numeration (A052382) and separated by zeros; triangle T(n,k), n >= 0, 1 <= k <= A000041(n), read by rows.

Original entry on oeis.org

0, 1, 2, 101, 3, 201, 10101, 4, 301, 202, 20101, 1010101, 5, 401, 302, 30101, 20201, 2010101, 101010101, 6, 501, 402, 40101, 303, 30201, 3010101, 20202, 2020101, 201010101, 10101010101, 7, 601, 502, 50101, 403, 40201, 4010101, 30301, 30202, 3020101, 301010101
Offset: 0

Views

Author

Alois P. Heinz, Feb 16 2020

Keywords

Comments

The encoding used here allows a lossless and human-readable compression of all partitions. To decode a term replace the zeros with commas and read the parts in bijective base 9.
The empty partition is encoded as 0.

Examples

			T(6,6) = 30201 encodes the 6th partition of 6: [3,2,1].
T(10,1) = 11 encodes the 1st partition of 10: [10].
T(23,23) = 18040101 encodes the 23rd partition of 23: [17,4,1,1].
Triangle T(n,k) begins:
   0;
   1;
   2, 101;
   3, 201, 10101;
   4, 301, 202, 20101, 1010101;
   5, 401, 302, 30101, 20201, 2010101, 101010101;
   6, 501, 402, 40101, 303, 30201, 3010101, 20202, 2020101, ...
   7, 601, 502, 50101, 403, 40201, 4010101, 30301, 30202, ...
   8, 701, 602, 60101, 503, 50201, 5010101, 404, 40301, 40202, ...
   9, 801, 702, 70101, 603, 60201, 6010101, 504, 50301, 50202, ...
  11, 901, 802, 80101, 703, 70201, 7010101, 604, 60301, 60202, ...
  ...
		

Crossrefs

Column k=1 gives A052382 (for n>0).
Last row elements give A094028(n-1) (for n>0).

Programs

  • Maple
    g:= proc(n) option remember; local d, m, l; m, l:= n, "";
          while m>0 do d:= irem(m, 9, 'm');
            if d=0 then d:=9; m:= m-1 fi; l:= d, l
          od; parse(cat(l))
        end:
    b:= (n, i)-> `if`(n=0, [""], `if`(i<1, [], [map(x-> cat(
         0, g(i), x), b(n-i, min(n-i, i)))[], b(n, i-1)[]])):
    T:= n-> map(x-> parse(cat(0, x)), b(n$2))[]:
    seq(T(n), n=0..10);

A332722 Index position of [2n-1, 2n-3, ..., 3, 1] within the list of partitions of n^2 in canonical ordering.

Original entry on oeis.org

1, 1, 2, 9, 74, 711, 7312, 77793, 848557, 9426039, 106218592, 1210785512, 13933358426, 161624712815, 1887635428421, 22176331059637, 261881397819259, 3106736469937751, 37006306302036790, 442425926101676831, 5306994321265281854, 63851605555921588684, 770371217568310624912
Offset: 0

Views

Author

Alois P. Heinz, Feb 20 2020

Keywords

Comments

The canonical ordering of partitions is described in A080577.

Examples

			a(3) = 9, because 531 has position 9 within the list of partitions of 3*3 in canonical ordering: 9, 81, 72, 711, 63, 621, 6111, 54, 531, ... .
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember;
         `if`(n=0, 1, b(n-i, i-2)+g(n, i-1))
        end:
    g:= proc(n, i) option remember; `if`(n=0 or i=1, 1,
         `if`(i<1, 0, g(n-i, min(n-i, i))+g(n, i-1)))
        end:
    a:= n-> g(n^2$2)-b(n^2, 2*n-1)+1:
    seq(a(n), n=0..23);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, b[n - i, i - 2] + g[n, i - 1]];
    g[n_, i_] := g[n, i] = If[n == 0 || i == 1, 1, If[i < 1, 0, g[n - i, Min[n - i, i]] + g[n, i - 1]]];
    a[n_] := g[n^2, n^2] - b[n^2, 2n - 1] + 1;
    a /@ Range[0, 23] (* Jean-François Alcover, May 10 2020, after Maple *)
Showing 1-8 of 8 results.