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.

A224956 Number of partitions of n where the difference between consecutive parts is at most 2.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 9, 11, 16, 19, 26, 31, 42, 50, 65, 78, 100, 119, 149, 178, 222, 263, 322, 382, 465, 549, 660, 778, 932, 1093, 1299, 1520, 1798, 2096, 2464, 2868, 3357, 3892, 4536, 5247, 6096, 7028, 8133, 9357, 10795, 12388, 14244, 16309, 18706, 21367, 24440, 27857, 31788, 36157
Offset: 0

Views

Author

Joerg Arndt, Apr 21 2013

Keywords

Comments

Also (by taking the conjugate), a(n) is the number of partitions of n such that all parts, with the possible exception of the largest are repeated at most twice. - Geoffrey Critzer, Sep 30 2013

Examples

			The a(7)=11 such partitions of 7 are
01:  [ 1 1 1 1 1 1 1 ]
02:  [ 2 1 1 1 1 1 ]
03:  [ 2 2 1 1 1 ]
04:  [ 2 2 2 1 ]
05:  [ 3 1 1 1 1 ]
06:  [ 3 2 1 1 ]
07:  [ 3 2 2 ]
08:  [ 3 3 1 ]
09:  [ 4 2 1 ]
10:  [ 4 3 ]
11:  [ 7 ]
The a(7)=11 partitions with no part (excepting the largest) repeated more than twice are the conjugates of the above respectively:
01:  [7]
02:  [6 1]
03:  [5 2]
04:  [4 3]
05:  [5 1 1]
06:  [4 2 1]
07:  [3 3 1]
08:  [3 2 2]
09:  [3 2 1 1]
10:  [2 2 2 1]
11:  [1 1 1 1 1 1 1]
		

Crossrefs

Sequences "number of partitions with max diff d": A000005 (d=0, for n>=1), A034296 (d=1), A224956 (d=2), A238863 (d=3), A238864 (d=4), A238865 (d=5), A238866 (d=6), A238867 (d=7), A238868 (d=8), A238869 (d=9), A000041 (d --> infinity).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1, `if`(j>0, 0, 1)), j=t..n/i)))
        end:
    a:= n-> add(b(n, k, 1), k=0..n):
    seq(a(n), n=0..70);  #  Alois P. Heinz, May 01 2013
  • Mathematica
    nn=53;CoefficientList[Series[1+Sum[x^k/(1-x^k)Product[1+x^i+x^(2i),{i,1,k-1}],{k,1,nn}],{x,0,nn}],x] (* Geoffrey Critzer, Sep 30 2013 *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, 1, If[i<1, 0, Sum[b[n-i*j, i-1, If[j>0, 0, 1]], {j, t, n/i}]]]; a[n_] := Sum[b[n, k, 1], {k, 0, n}]; Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Jun 19 2015, after Alois P. Heinz *)
  • PARI
    N=66;  q = 'q + O('q^N);
    Vec ( 1 + sum(k=1, N, q^k/(1-q^k) * prod(i=1,k-1, 1+q^i+q^(2*i) ) ) )
    \\ Joerg Arndt, Mar 08 2014

Formula

O.g.f.: 1 + sum(k>=1, x^k/(1-x^k) * prod(i=1..k-1, 1+x^i+x^(2*i) ) ). - Geoffrey Critzer, Sep 30 2013
a(n) = Sum_{k=0..2} A238353(n,k). - Alois P. Heinz, Mar 09 2014
a(n) ~ exp(2*Pi*sqrt(n)/3) / (6 * n^(3/4)). - Vaclav Kotesovec, Jan 26 2022