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.

Previous Showing 11-20 of 237 results. Next

A066633 Triangle T(n,k), n >= 1, 1 <= k <= n, giving number of k's in all partitions of n.

Original entry on oeis.org

1, 2, 1, 4, 1, 1, 7, 3, 1, 1, 12, 4, 2, 1, 1, 19, 8, 4, 2, 1, 1, 30, 11, 6, 3, 2, 1, 1, 45, 19, 9, 6, 3, 2, 1, 1, 67, 26, 15, 8, 5, 3, 2, 1, 1, 97, 41, 21, 13, 8, 5, 3, 2, 1, 1, 139, 56, 31, 18, 12, 7, 5, 3, 2, 1, 1, 195, 83, 45, 28, 17, 12, 7, 5, 3, 2, 1, 1, 272, 112, 63, 38, 25, 16, 11, 7, 5, 3, 2, 1, 1
Offset: 1

Views

Author

Naohiro Nomoto, Jan 09 2002

Keywords

Comments

It appears that row n lists the first differences of the row n of triangle A181187 together with 1 (as the final term of the row n). - Omar E. Pol, Feb 26 2012
It appears that reversed rows converge to A000041. - Omar E. Pol, Mar 11 2012
Proof: For a partition of n with k>floor(n/2+1), k can only occur as the largest part; the other parts sum to n-k, so that T(n,n-k)=A000041(k). - George Beck, Jun 30 2019
T(n,k) is also the total number k's that are divisors of all positive integers in a sequence with n blocks where the m-th block consists of A000041(n-m) copies of m, with 1 <= m <= n. - Omar E. Pol, Feb 05 2021

Examples

			For n = 3, k = 1; 3 = 2+1 = 1+1+1. T(3,1) = (zero 1's) + (one 1's) + (three 1's), so T(3,1) = 4.
Triangle begins:
    1;
    2,   1;
    4,   1,  1;
    7,   3,  1,  1;
   12,   4,  2,  1,  1;
   19,   8,  4,  2,  1,  1;
   30,  11,  6,  3,  2,  1,  1;
   45,  19,  9,  6,  3,  2,  1, 1;
   67,  26, 15,  8,  5,  3,  2, 1, 1;
   97,  41, 21, 13,  8,  5,  3, 2, 1, 1;
  139,  56, 31, 18, 12,  7,  5, 3, 2, 1, 1;
  195,  83, 45, 28, 17, 12,  7, 5, 3, 2, 1, 1;
  272, 112, 63, 38, 25, 16, 11, 7, 5, 3, 2, 1, 1;
  ...
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.2.1.5, Problem 73(b), pp. 415, 761. - N. J. A. Sloane, Dec 30 2018

Crossrefs

Row sums give positive terms of A006128.
Columns (1-10): A000070, A024786-A024794.

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0 or i=1, 1+n*x, b(n, i-1)+
          `if`(i>n, 0, (g->g+coeff(g, x, 0)*x^i)(b(n-i, i))))
        end:
    T:= n-> (p->seq(coeff(p, x, i), i=1..n))(b(n, n)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Mar 21 2012
  • Mathematica
    Table[Count[Flatten[IntegerPartitions[n]],k],
    {n,1,20},{k,1,n}]
    TableForm[% ] (* as a triangle *)
    Flatten[%%]   (* as a sequence *)
    (* Clark Kimberling, Mar 03 2010 *)
    T[n_, n_] = 1; T[n_, k_] /; k, ] = 0; Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 21 2015, after Omar E. Pol *)
  • Python
    from math import isqrt, comb
    from sympy import partition
    def A066633(n):
        a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
        b = n-comb(a,2)
        return sum(partition(j) for j in range(a%b,a,b)) # Chai Wah Wu, Nov 13 2024

Formula

G.f. for the number of k's in all partitions of n is x^k/(1-x^k)* Product_{m>=1} 1/(1-x^m). - Vladeta Jovovic, Jan 15 2002
T(n, k) = Sum_{j
Equals triangle A027293 * A051731 as infinite lower triangular matrices. - Gary W. Adamson Mar 21 2011
It appears that T(n+k,k) = T(n,k) + A000041(n). - Omar E. Pol, Feb 04 2012. This was proved in the Dastidar-Gupta paper in Lemma 1. - George Beck, Jun 26 2019
It appears that T(n,k) = A206563(n,k) - A206563(n,k+2). - Omar E. Pol, Feb 26 2012
T(n,k) = Sum_{j=1..n} A182703(j,k). - Omar E. Pol, May 02 2012

Extensions

More terms from Vladeta Jovovic, Jan 11 2002

A015723 Number of parts in all partitions of n into distinct parts.

Original entry on oeis.org

1, 1, 3, 3, 5, 8, 10, 13, 18, 25, 30, 40, 49, 63, 80, 98, 119, 149, 179, 218, 266, 318, 380, 455, 541, 640, 760, 895, 1050, 1234, 1442, 1679, 1960, 2272, 2635, 3052, 3520, 4054, 4669, 5359, 6142, 7035, 8037, 9170, 10460, 11896, 13517, 15349, 17394, 19691
Offset: 1

Keywords

Examples

			The strict integer partitions of 6 are {(6), (5,1), (4,2), (3,2,1)} with a total of 1 + 2 + 2 + 3 = 8 parts, so a(6) = 8. - _Gus Wiseman_, May 09 2019
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, [1, 0], `if`(i<1, [0, 0],
          add((l->[l[1], l[2]+l[1]*j])(b(n-i*j, i-1)), j=0..min(n/i, 1))))
        end:
    a:= n-> b(n, n)[2]:
    seq(a(n), n=1..50);  # Alois P. Heinz, Feb 27 2013
  • Mathematica
    nn=50; Rest[CoefficientList[Series[D[Product[1+y x^i,{i,1,nn}],y]/.y->1,{x,0,nn}],x]]  (* Geoffrey Critzer, Oct 29 2012; fixed by Vaclav Kotesovec, Apr 16 2016 *)
    q[n_, k_] := q[n, k] = If[nVaclav Kotesovec, Apr 16 2016 *)
    Table[Length[Join@@Select[IntegerPartitions[n],UnsameQ@@#&]],{n,1,50}] (* Gus Wiseman, May 09 2019 *)
    b[n_, i_] := b[n, i] = If[n == 0, {1, 0}, If[i<1, {0, 0},
       Sum[{#[[1]], #[[2]] + #[[1]]*j}&@ b[n-i*j, i-1], {j, 0, Min[n/i, 1]}]]];
    a[n_] := b[n, n][[2]];
    Array[a, 50] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)
  • PARI
    N=66;  q='q+O('q^N); gf=sum(n=0,N, n*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
    Vec(gf) /* Joerg Arndt, Oct 20 2012 */

Formula

G.f.: sum(k>=1, x^k/(1+x^k) ) * prod(m>=1, 1+x^m ). Convolution of A048272 and A000009. - Vladeta Jovovic, Nov 26 2002
G.f.: sum(k>=1, k*x^(k*(k+1)/2)/prod(i=1..k, 1-x^i ) ). - Vladeta Jovovic, Sep 21 2005
a(n) = A238131(n)+A238132(n) = sum_{k=1..n} A048272(k)*A000009(n-k). - Mircea Merca, Feb 26 2014
a(n) = Sum_{k>=1} k*A008289(n,k). - Vaclav Kotesovec, Apr 16 2016
a(n) ~ 3^(1/4) * log(2) * exp(Pi*sqrt(n/3)) / (2 * Pi * n^(1/4)). - Vaclav Kotesovec, May 19 2018
For n > 0, a(n) = A116676(n) + A116680(n). - Vaclav Kotesovec, May 26 2018

Extensions

Extended and corrected by Naohiro Nomoto, Feb 24 2002

A211992 Triangle read by rows in which row n lists the partitions of n in colexicographic order.

Original entry on oeis.org

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

Author

Omar E. Pol, Aug 18 2012

Keywords

Comments

The order of the partitions of every integer is reversed with respect to A026792. For example: in A026792 the partitions of 3 are listed as [3], [2, 1], [1, 1, 1], however here the partitions of 3 are listed as [1, 1, 1], [2, 1], [3].
Row n has length A006128(n). Row sums give A066186. Right border gives A000027. The equivalent sequence for compositions (ordered partitions) is A228525. - Omar E. Pol, Aug 24 2013
The representation of the partitions (for fixed n) is as (weakly) decreasing lists of parts, the order between individual partitions (for the same n) is co-lexicographic. The equivalent sequence for partitions as (weakly) increasing lists and lexicographic order is A026791. - Joerg Arndt, Sep 02 2013

Examples

			From _Omar E. Pol_, Aug 24 2013: (Start)
Illustration of initial terms:
-----------------------------------------
n      Diagram          Partition
-----------------------------------------
.       _
1      |_|              1;
.       _ _
2      |_| |            1, 1,
2      |_ _|            2;
.       _ _ _
3      |_| | |          1, 1, 1,
3      |_ _| |          2, 1,
3      |_ _ _|          3;
.       _ _ _ _
4      |_| | | |        1, 1, 1, 1,
4      |_ _| | |        2, 1, 1,
4      |_ _ _| |        3, 1,
4      |_ _|   |        2, 2,
4      |_ _ _ _|        4;
.       _ _ _ _ _
5      |_| | | | |      1, 1, 1, 1, 1,
5      |_ _| | | |      2, 1, 1, 1,
5      |_ _ _| | |      3, 1, 1,
5      |_ _|   | |      2, 2, 1,
5      |_ _ _ _| |      4, 1,
5      |_ _ _|   |      3, 2,
5      |_ _ _ _ _|      5;
.       _ _ _ _ _ _
6      |_| | | | | |    1, 1, 1, 1, 1, 1,
6      |_ _| | | | |    2, 1, 1, 1, 1,
6      |_ _ _| | | |    3, 1, 1, 1,
6      |_ _|   | | |    2, 2, 1, 1,
6      |_ _ _ _| | |    4, 1, 1,
6      |_ _ _|   | |    3, 2, 1,
6      |_ _ _ _ _| |    5, 1,
6      |_ _|   |   |    2, 2, 2,
6      |_ _ _ _|   |    4, 2,
6      |_ _ _|     |    3, 3,
6      |_ _ _ _ _ _|    6;
...
Triangle begins:
[1];
[1,1], [2];
[1,1,1], [2,1], [3];
[1,1,1,1], [2,1,1], [3,1], [2,2], [4];
[1,1,1,1,1], [2,1,1,1], [3,1,1], [2,2,1], [4,1], [3,2], [5];
[1,1,1,1,1,1], [2,1,1,1,1], [3,1,1,1], [2,2,1,1], [4,1,1], [3,2,1], [5,1], [2,2,2], [4,2], [3,3], [6];
(End)
From _Gus Wiseman_, May 10 2020: (Start)
The triangle with partitions shown as Heinz numbers (A334437) begins:
    1
    2
    4   3
    8   6   5
   16  12  10   9   7
   32  24  20  18  14  15  11
   64  48  40  36  28  30  22  27  21  25  13
  128  96  80  72  56  60  44  54  42  50  26  45  33  35  17
(End)
		

Crossrefs

The graded reversed version is A026792.
The length-sensitive refinement is A036037.
The version for reversed partitions is A080576.
Partition lengths are A193173.
Partition maxima are A194546.
Partition minima are A196931.
The version for compositions is A228525.
The Heinz numbers of these partitions are A334437.

Programs

  • Mathematica
    colex[f_,c_]:=OrderedQ[PadRight[{Reverse[f],Reverse[c]}]];
    Join@@Table[Sort[IntegerPartitions[n],colex],{n,0,6}] (* Gus Wiseman, May 10 2020 *)
  • PARI
    gen_part(n)=
    {  /* Generate partitions of n as weakly increasing lists (order is lex): */
        my(ct = 0);
        my(m, pt);
        my(x, y);
        \\ init:
        my( a = vector( n + (n<=1) ) );
        a[1] = 0;  a[2] = n;  m = 2;
        while ( m!=1,
            y = a[m] - 1;
            m -= 1;
            x = a[m] + 1;
            while ( x<=y,
                a[m] = x;
                y = y - x;
                m += 1;
            );
            a[m] = x + y;
            pt = vector(m, j, a[j]);
        /* for A026791 print partition: */
    \\        for (j=1, m, print1(pt[j],", ") );
        /* for A211992 print partition as weakly decreasing list (order is colex): */
            forstep (j=m, 1, -1, print1(pt[j],", ") );
            ct += 1;
        );
        return(ct);
    }
    for(n=1, 10, gen_part(n) );
    \\ Joerg Arndt, Sep 02 2013

A092269 Spt function: total number of smallest parts (counted with multiplicity) in all partitions of n.

Original entry on oeis.org

1, 3, 5, 10, 14, 26, 35, 57, 80, 119, 161, 238, 315, 440, 589, 801, 1048, 1407, 1820, 2399, 3087, 3998, 5092, 6545, 8263, 10486, 13165, 16562, 20630, 25773, 31897, 39546, 48692, 59960, 73423, 89937, 109553, 133439, 161840, 196168, 236843, 285816, 343667, 412950, 494702, 592063, 706671
Offset: 1

Author

Vladeta Jovovic, Feb 16 2004

Keywords

Comments

Row sums of triangle A220504. - Omar E. Pol, Jan 19 2013

Examples

			Partitions of 4 are [1,1,1,1], [1,1,2], [2,2], [1,3], [4]. 1 appears 4 times in the first, 1 twice in the second, 2 twice in the third, etc.; thus a(4)=4+2+2+1+1=10.
		

Crossrefs

For higher-order spt functions see A221140-A221144.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, n,
          `if`(irem(n, i, 'r')=0, r, 0)+add(b(n-i*j, i-1), j=0..n/i))
        end:
    a:= n-> b(n, n):
    seq(a(n), n=1..60);  # Alois P. Heinz, Jan 16 2013
  • Mathematica
    terms = 47; gf = Sum[x^n/(1 - x^n)*Product[1/(1 - x^k), {k, n, terms}], {n, 1, terms}]; CoefficientList[ Series[gf, {x, 0, terms}], x] // Rest (* Jean-François Alcover, Jan 17 2013 *)
    b[n_, i_] := b[n, i] = If[n==0 || i==1, n, {q, r} = QuotientRemainder[n, i]; If[r==0, q, 0] + Sum[b[n-i*j, i-1], {j, 0, n/i}]]; a[n_] := b[n, n]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Nov 23 2015, after Alois P. Heinz *)
  • PARI
    N = 66;  x = 'x + O('x^N);
    gf = sum(n=1,N, x^n/(1-x^n) * prod(k=n,N, 1/(1-x^k) )  );
    v = Vec(gf)
    /* Joerg Arndt, Jan 12 2013 */

Formula

G.f.: Sum_{n>=1} x^n/(1-x^n) * Product_{k>=n} 1/(1-x^k).
a(n) = A000070(n-1) + A195820(n). - Omar E. Pol, Oct 19 2011
a(n) = n*p(n) - N_2(n)/2 = n*A000041(n) - A220908(n)/2 = A066186(n) - A220907(n) = (A220909(n) - A220908(n))/2 = A211982(n)/2 (from Andrews's paper and Garvan's paper). - Omar E. Pol, Jan 03 2013
a(n) = A000041(n) + A000070(n-2) + A220479(n), n >= 2. - Omar E. Pol, Feb 16 2013
Asymptotics (Bringmann-Mahlburg, 2009): a(n) ~ exp(Pi*sqrt(2*n/3)) / (Pi*sqrt(8*n)) ~ sqrt(6*n)*A000041(n)/Pi. - Vaclav Kotesovec, Jul 30 2017

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 25 2004

A194446 Number of parts in the n-th region of the set of partitions of j, if 1<=n<=A000041(j).

Original entry on oeis.org

1, 2, 3, 1, 5, 1, 7, 1, 2, 1, 11, 1, 2, 1, 15, 1, 2, 1, 4, 1, 1, 22, 1, 2, 1, 4, 1, 2, 1, 30, 1, 2, 1, 4, 1, 1, 7, 1, 2, 1, 1, 42, 1, 2, 1, 4, 1, 2, 1, 8, 1, 1, 3, 1, 1, 56, 1, 2, 1, 4, 1, 1, 7, 1, 2, 1, 1, 12, 1, 2, 1, 4, 1, 2, 1, 1, 77, 1, 2, 1
Offset: 1

Author

Omar E. Pol, Nov 26 2011

Keywords

Comments

For the definition of "region" of the set of partitions of j, see A206437.
a(n) is also the number of positive integers in the n-th row of triangle A186114. a(n) is also the number of positive integers in the n-th row of triangle A193870.
Also triangle read by rows: T(j,k) = number of parts in the k-th region of the last section of the set of partitions of j. See example. For more information see A135010.
a(n) is also the length of the n-th vertical line segment in the minimalist diagram of regions and partitions. The length of the n-th horizontal line segment is A141285(n). See also A194447. - Omar E. Pol, Mar 04 2012
From Omar E. Pol, Aug 19 2013: (Start)
In order to construct this sequence with a cellular automaton we use the following rules: We start in the first quadrant of the square grid with no toothpicks. At stage n we place A141285(n) toothpicks of length 1 connected by their endpoints in horizontal direction starting from the point (0, n). Then we place toothpicks of length 1 connected by their endpoints in vertical direction starting from the exposed toothpick endpoint downward up to touch the structure or up to touch the x-axis. a(n) is the number of toothpicks in vertical direction added at n-th stage (see example section and A139250, A225600, A225610).
a(n) is also the length of the n-th descendent line segment in an infinite Dyck path in which the length of the n-th ascendent line segment is A141285(n). See Example section. For more information see A211978, A220517, A225600.
(End)
The equivalent sequence for compositions is A006519. - Omar E. Pol, Aug 22 2013

Examples

			Written as an irregular triangle the sequence begins:
  1;
  2;
  3;
  1, 5;
  1, 7;
  1, 2, 1, 11;
  1, 2, 1, 15;
  1, 2, 1,  4, 1, 1, 22;
  1, 2, 1,  4, 1, 2,  1, 30;
  1, 2, 1,  4, 1, 1,  7,  1, 2, 1, 1, 42;
  1, 2, 1,  4, 1, 2,  1,  8, 1, 1, 3,  1, 1, 56;
  1, 2, 1,  4, 1, 1,  7,  1, 2, 1, 1, 12, 1,  2, 1, 4, 1, 2, 1, 1, 77;
  ...
From _Omar E. Pol_, Aug 18 2013: (Start)
Illustration of initial terms (first seven regions):
.                                             _ _ _ _ _
.                                     _ _ _  |_ _ _ _ _|
.                           _ _ _ _  |_ _ _|       |_ _|
.                     _ _  |_ _ _ _|                 |_|
.             _ _ _  |_ _|     |_ _|                 |_|
.       _ _  |_ _ _|             |_|                 |_|
.   _  |_ _|     |_|             |_|                 |_|
.  |_|   |_|     |_|             |_|                 |_|
.
.   1     2       3     1         5       1           7
.
The next figure shows a minimalist diagram of the first seven regions. The n-th horizontal line segment has length A141285(n). a(n) is the length of the n-th vertical line segment, which is the vertical line segment ending in row n (see also A225610).
.      _ _ _ _ _
.  7   _ _ _    |
.  6   _ _ _|_  |
.  5   _ _    | |
.  4   _ _|_  | |
.  3   _ _  | | |
.  2   _  | | | |
.  1    | | | | |
.
.      1 2 3 4 5
.
Illustration of initial terms from an infinite Dyck path in which the length of the n-th ascendent line segment is A141285(n). a(n) is the length of the n-th descendent line segment.
.                                    /\
.                                   /  \
.                      /\          /    \
.                     /  \        /      \
.            /\      /    \    /\/        \
.       /\  /  \  /\/      \  / 1          \
.    /\/  \/    \/ 1        \/              \
.     1   2     3           5               7
.
(End)
		

Crossrefs

Row j has length A187219(j). Right border gives A000041, j >= 1. Records give A000041, j >= 1. Row sums give A138137.

Programs

  • Mathematica
    lex[n_]:=DeleteCases[Sort@PadRight[Reverse /@ IntegerPartitions@n], x_ /; x==0,2];
    A194446 = {}; l = {};
    For[j = 1, j <= 30, j++,
      mx = Max@lex[j][[j]]; AppendTo[l, mx];
      For[i = j, i > 0, i--, If[l[[i]] > mx, Break[]]];
      AppendTo[A194446, j - i];
      ];
    A194446   (* Robert Price, Jul 25 2020 *)

Formula

a(n) = A141285(n) - A194447(n). - Omar E. Pol, Mar 04 2012

A181187 Triangle read by rows: T(n,k) = sum of k-th largest elements in all partitions of n.

Original entry on oeis.org

1, 3, 1, 6, 2, 1, 12, 5, 2, 1, 20, 8, 4, 2, 1, 35, 16, 8, 4, 2, 1, 54, 24, 13, 7, 4, 2, 1, 86, 41, 22, 13, 7, 4, 2, 1, 128, 61, 35, 20, 12, 7, 4, 2, 1, 192, 95, 54, 33, 20, 12, 7, 4, 2, 1, 275, 136, 80, 49, 31, 19, 12, 7, 4, 2, 1, 399, 204, 121, 76, 48, 31, 19, 12, 7, 4, 2, 1, 556, 284
Offset: 1

Author

Wouter Meeussen, Oct 09 2010

Keywords

Comments

For the connection with A066897 and A066898 see A206563. - Omar E. Pol, Feb 13 2012
T(n,k) is also the total number of parts >= k in all partitions of n. - Omar E. Pol, Feb 14 2012
The first differences of row n together with 1 give the row n of triangle A066633. - Omar E. Pol, Feb 26 2012
We define the k-th rank of a partition as the k-th part minus the number of parts >= k. Since the first part of a partition is also the largest part of the same partition so the Dyson's rank of a partition is the case for k = 1. It appears that the sum of the k-th ranks of all partitions of n is equal to zero. - Omar E. Pol, Mar 04 2012
T(n,k) is also the total number of divisors >= k of all positive integers in a sequence with n blocks where the m-th block consists of A000041(n-m) copies of m, with 1 <= m <= n. - Omar E. Pol, Feb 05 2021

Examples

			From _Omar E. Pol_, Feb 13 2012: (Start)
Illustration of initial terms. First five rows of triangle as sums of columns from the partitions of the first five positive integers:
.
.                            5
.                            3+2
.                  4         4+1
.                  2+2       2+2+1
.          3       3+1       3+1+1
.     2    2+1     2+1+1     2+1+1+1
.  1  1+1  1+1+1   1+1+1+1   1+1+1+1+1
. -------------------------------------
.  1, 3,1, 6,2,1, 12,5,2,1, 20,8,4,2,1 --> This triangle
.  |  |/|  |/|/|   |/|/|/|   |/|/|/|/|
.  1, 2,1, 4,1,1,  7,3,1,1, 12,4,2,1,1 --> A066633
.
For more information see A207031 and A206563.
...
Triangle begins:
    1;
    3,   1;
    6,   2,   1;
   12,   5,   2,  1;
   20,   8,   4,  2,  1;
   35,  16,   8,  4,  2,  1;
   54,  24,  13,  7,  4,  2,  1;
   86,  41,  22, 13,  7,  4,  2,  1;
  128,  61,  35, 20, 12,  7,  4,  2, 1;
  192,  95,  54, 33, 20, 12,  7,  4, 2, 1;
  275, 136,  80, 49, 31, 19, 12,  7, 4, 2, 1;
  399, 204, 121, 76, 48, 31, 19, 12, 7, 4, 2, 1;
(End)
		

Crossrefs

Row sums are A066186. First column is A006128. Reverse of each row converges to A000070.
Columns 2-3: A096541, A207033. - Omar E. Pol, Feb 18 2012
T(2n,n) gives A216053(n+1).
Cf. A206283.

Programs

  • Maple
    p:= (f, g)-> zip((x, y)-> x+y, f, g, 0):
    b:= proc(n, i) option remember; local f, g;
          if n=0 or i=1 then [1, n]
        else f:= b(n, i-1); g:= `if`(i>n, [0], b(n-i, i));
             p(p(f, g), [0$i, g[1]])
          fi
        end:
    T:= proc(n) local j, l, r, t;
          l, r, t:= b(n, n), 1, 1;
          for j from n to 2 by -1 do t:= t+l[j]; r:=r, t od;
          seq([r][1+n-j], j=1..n)
        end:
    seq(T(n), n=1..14); # Alois P. Heinz, Apr 05 2012
  • Mathematica
    Table[Plus @@ (PadRight[ #,n]& /@ IntegerPartitions[n]),{n,16}]
    (* Second program: *)
    T[n_, n_] = 1; T[n_, k_] /; k, ] = 0; Table[Table[T[n, k], {k, n, 1, -1}] // Accumulate // Reverse, {n, 1, 16}] // Flatten (* Jean-François Alcover, Oct 10 2015, after Omar E. Pol *)

Formula

T(n,k) = Sum_{j=1..n} A207031(j,k). - Omar E. Pol, May 02 2012

Extensions

Better definition from Omar E. Pol, Feb 13 2012

A257993 Least gap in the partition having Heinz number n; index of the least prime not dividing n.

Original entry on oeis.org

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

Author

Emeric Deutsch, May 18 2015

Keywords

Comments

The "least gap" of a partition is the least positive integer that is not a part of the partition. For example, the least gap of the partition [7,4,2,2,1] is 3.
We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436.
In the Maple program the subprogram B yields the partition with Heinz number n.
Sum of least gaps of all partitions of m = A022567(m).
From Antti Karttunen, Aug 22 2016: (Start)
Index of the least prime not dividing n. (After a formula given by Heinz.)
Least k such that A002110(k) does not divide n.
One more than the number of trailing zeros in primorial base representation of n, A049345.
(End)
The least gap is also called the mex (minimal excludant) of the partition. - Gus Wiseman, Apr 20 2021

Examples

			a(18) = 3 because the partition having Heinz number 18 = 2*3*3 is [1,2,2], having least gap equal to 3.
		

References

  • G. E. Andrews and K. Eriksson, Integer Partitions, Cambridge Univ. Press, 2004, Cambridge.
  • Miklós Bóna, A Walk Through Combinatorics, World Scientific Publishing Co., 2002.

Crossrefs

Positions of 1's are A005408.
Positions of 2's are A047235.
The number of gaps is A079067.
The version for crank is A257989.
The triangle counting partitions by this statistic is A264401.
One more than A276084.
The version for greatest difference is A286469 or A286470.
A maximal instead of minimal version is A339662.
Positions of even terms are A342050.
Positions of odd terms are A342051.
A000070 counts partitions with a selected part.
A006128 counts partitions with a selected position.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A238709 counts partitions by sum and least difference.
A333214 lists positions of adjacent unequal prime gaps.
A339737 counts partitions by sum and greatest gap.

Programs

  • Maple
    with(numtheory): a := proc (n) local B, q: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: for q while member(q, B(n)) = true do  end do: q end proc: seq(a(n), n = 1 .. 150);
    # second Maple program:
    a:= n-> `if`(n=1, 1, (s-> min({$1..(max(s)+1)} minus s))(
            {map(x-> numtheory[pi](x[1]), ifactors(n)[2])[]})):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 09 2016
    # faster:
    A257993 := proc(n) local p, c; c := 1; p := 2;
    while n mod p = 0 do p := nextprime(p); c := c + 1 od: c end:
    seq(A257993(n), n=1..100); # Peter Luschny, Jun 04 2017
  • Mathematica
    A053669[n_] := For[p = 2, True, p = NextPrime[p], If[CoprimeQ[p, n], Return[p]]]; a[n_] := PrimePi[A053669[n]]; Array[a, 100] (* Jean-François Alcover, Nov 28 2016 *)
    Table[k = 1; While[! CoprimeQ[Prime@ k, n], k++]; k, {n, 100}] (* Michael De Vlieger, Jun 22 2017 *)
  • PARI
    a(n) = forprime(p=2,, if (n % p, return(primepi(p)))); \\ Michel Marcus, Jun 22 2017
  • Python
    from sympy import nextprime, primepi
    def a053669(n):
        p = 2
        while True:
            if n%p!=0: return p
            else: p=nextprime(p)
    def a(n): return primepi(a053669(n)) # Indranil Ghosh, May 12 2017
    
  • Scheme
    (define (A257993 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) i (loop (/ (- n d) p) (+ 1 i))))))
    ;; Antti Karttunen, Aug 22 2016
    

Formula

a(n) = A000720(A053669(n)). - Alois P. Heinz, May 18 2015
From Antti Karttunen, Aug 22-30 2016: (Start)
a(n) = 1 + A276084(n).
a(n) = A055396(A276086(n)).
A276152(n) = A002110(a(n)).
(End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1 + Sum_{k>=1} 1/A002110(k) = 1.705230... (1 + A064648). - Amiram Eldar, Jul 23 2022
a(n) << log n/log log n. - Charles R Greathouse IV, Dec 03 2022

Extensions

A simpler description added to the name by Antti Karttunen, Aug 22 2016

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

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

A186114 Triangle of regions and partitions of integers (see Comments lines for definition).

Original entry on oeis.org

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

Author

Omar E. Pol, Aug 08 2011

Keywords

Comments

Let r = T(n,k) be a record in the sequence. The consecutive records "r" are the natural numbers A000027. Consider the first n rows; the triangle T(n,k) has the property that the columns, without the zeros, from k..1, are also the partitions of r in juxtaposed reverse-lexicographical order, so k is also A000041(r), the number of partitions of r. Note that a record r is always the final term of a row if such row contains 1’s. The number of positive integer a(1)..r is A006128(r). The sums a(1)..r is A066186(r). Here the set of positive integers in every row (from 1 to n) is called a “region” of r. The number of regions of r equals the number of partitions of r. If T(n,1) = 1 then the row n is formed by the smallest parts, in nondecreasing order, of all partitions of T(n,n).

Examples

			Triangle begins:
1,
1, 2,
1, 1, 3,
0, 0, 0, 2,
1, 1, 1, 2, 4,
0, 0, 0, 0, 0, 3,
1, 1, 1, 1, 1, 2, 5,
0, 0, 0, 0, 0, 0, 0, 2,
0, 0, 0, 0, 0, 0, 0, 2, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 6
...
The row n = 11 contains the 6th record in the sequence:  a(66) = T(11,11) = 6, then consider the first 11 rows of triangle. Note that the columns, from k = 11..1, without the zeros, are also the 11 partitions of 6 in juxtaposed reverse-lexicographical order: [6], [3, 3], [4, 2], [2, 2, 2], [5, 1], [3, 2, 1], [4, 1, 1], [2, 2, 1, 1], [3, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]. See A026792.
		

Crossrefs

Mirror of triangle A193870. Column 1 gives A167392. Right diagonal gives A141285.

Programs

Formula

T(n,1) = A167392(n).
T(n,k) = A141285(n), if k = n.

A193073 Triangle in which n-th row lists all partitions of n, in graded lexicographical ordering.

Original entry on oeis.org

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

Author

M. F. Hasler, Jul 15 2011

Keywords

Comments

The partitions of the integer n are sorted in lexicographical order (cf. link: sums are written with terms in decreasing order, then they are sorted in lexicographical (increasing) order), i.e., as [1,1,...,1], [2,1,...,1], [2,2,...], ..., [n].

Examples

			First five rows are:
[[1]]
[[1, 1], [2]]
[[1, 1, 1], [2, 1], [3]]
[[1, 1, 1, 1], [2, 1, 1], [2, 2], [3, 1], [4]]
[[1, 1, 1, 1, 1], [2, 1, 1, 1], [2, 2, 1], [3, 1, 1], [3, 2], [4, 1], [5]]
From _Gus Wiseman_, May 08 2020: (Start)
The sequence of all partitions begins:
  ()           (2,2,1)        (5,1)            (5,2)
  (1)          (3,1,1)        (6)              (6,1)
  (1,1)        (3,2)          (1,1,1,1,1,1,1)  (7)
  (2)          (4,1)          (2,1,1,1,1,1)    (1,1,1,1,1,1,1,1)
  (1,1,1)      (5)            (2,2,1,1,1)      (2,1,1,1,1,1,1)
  (2,1)        (1,1,1,1,1,1)  (2,2,2,1)        (2,2,1,1,1,1)
  (3)          (2,1,1,1,1)    (3,1,1,1,1)      (2,2,2,1,1)
  (1,1,1,1)    (2,2,1,1)      (3,2,1,1)        (2,2,2,2)
  (2,1,1)      (2,2,2)        (3,2,2)          (3,1,1,1,1,1)
  (2,2)        (3,1,1,1)      (3,3,1)          (3,2,1,1,1)
  (3,1)        (3,2,1)        (4,1,1,1)        (3,2,2,1)
  (4)          (3,3)          (4,2,1)          (3,3,1,1)
  (1,1,1,1,1)  (4,1,1)        (4,3)            (3,3,2)
  (2,1,1,1)    (4,2)          (5,1,1)          (4,1,1,1,1)
The triangle with partitions shown as Heinz numbers (A334434) begins:
    1
    2
    4   3
    8   6   5
   16  12   9  10   7
   32  24  18  20  15  14  11
   64  48  36  27  40  30  25  28  21  22  13
  128  96  72  54  80  60  45  50  56  42  35  44  33  26  17
(End)
		

Crossrefs

See A036036 for the Hindenburg (graded reflected colexicographic) ordering (listed in the Abramowitz and Stegun Handbook).
See A036037 for graded colexicographic ordering.
See A080576 for the Maple (graded reflected lexicographic) ordering.
See A080577 for the Mathematica (graded reverse lexicographic) ordering.
See A228100 for the Fenner-Loizou (binary tree) ordering.
A006128 gives row lengths.
Row n has A000041(n) partitions.
The version for reversed (weakly increasing) partitions is A026791.
Lengths of these partitions appear to be A049085.
Taking colex instead of lex gives A211992.
The generalization to compositions is A228351.
Sorting partitions by Heinz number gives A296150.
The length-sensitive refinement is A334301.
The Heinz numbers of these partitions are A334434.

Programs

  • Mathematica
    row[n_] := Flatten[Reverse[Reverse /@ SplitBy[IntegerPartitions[n], Length] ], 1]; Array[row, 19] // Flatten (* Jean-François Alcover, Dec 05 2016 *)
    lexsort[f_,c_]:=OrderedQ[PadRight[{f,c}]];
    Join@@Table[Sort[IntegerPartitions[n],lexsort],{n,0,8}] (* Gus Wiseman, May 08 2020 *)
  • PARI
    A193073_row(n)=concat(vecsort(apply(P->Vec(vecsort(P,,4)),partitions(n)))) \\ The two vecsort() are needed since the PARI function (version >= 2.7.1) yields the partitions in Abramowitz-Stegun order: sorted by increasing length, decreasing largest part, then lex order, with parts in increasing order. - M. F. Hasler, Jun 04 2018 [replaced older code from Jul 12 2015]
    
  • Sage
    def p(n, i):
        if n==0 or i==1: return [[1]*n]
        T = [[i] + x for x in p(n-i, i)] if i<=n else []
        return p(n, i-1) + T
    A193073 = lambda n: p(n,n)
    for n in (1..5): print(A193073(n)) # Peter Luschny, Aug 07 2015
Previous Showing 11-20 of 237 results. Next