Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #40 Jan 26 2022 05:13:45
%S 1,1,2,3,5,6,9,11,16,19,26,31,42,50,65,78,100,119,149,178,222,263,322,
%T 382,465,549,660,778,932,1093,1299,1520,1798,2096,2464,2868,3357,3892,
%U 4536,5247,6096,7028,8133,9357,10795,12388,14244,16309,18706,21367,24440,27857,31788,36157
%N Number of partitions of n where the difference between consecutive parts is at most 2.
%C 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
%H Vaclav Kotesovec, <a href="/A224956/b224956.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..1000 from Alois P. Heinz)
%F 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
%F a(n) = Sum_{k=0..2} A238353(n,k). - _Alois P. Heinz_, Mar 09 2014
%F a(n) ~ exp(2*Pi*sqrt(n)/3) / (6 * n^(3/4)). - _Vaclav Kotesovec_, Jan 26 2022
%e The a(7)=11 such partitions of 7 are
%e 01: [ 1 1 1 1 1 1 1 ]
%e 02: [ 2 1 1 1 1 1 ]
%e 03: [ 2 2 1 1 1 ]
%e 04: [ 2 2 2 1 ]
%e 05: [ 3 1 1 1 1 ]
%e 06: [ 3 2 1 1 ]
%e 07: [ 3 2 2 ]
%e 08: [ 3 3 1 ]
%e 09: [ 4 2 1 ]
%e 10: [ 4 3 ]
%e 11: [ 7 ]
%e The a(7)=11 partitions with no part (excepting the largest) repeated more than twice are the conjugates of the above respectively:
%e 01: [7]
%e 02: [6 1]
%e 03: [5 2]
%e 04: [4 3]
%e 05: [5 1 1]
%e 06: [4 2 1]
%e 07: [3 3 1]
%e 08: [3 2 2]
%e 09: [3 2 1 1]
%e 10: [2 2 2 1]
%e 11: [1 1 1 1 1 1 1]
%p b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1, 0,
%p add(b(n-i*j, i-1, `if`(j>0, 0, 1)), j=t..n/i)))
%p end:
%p a:= n-> add(b(n, k, 1), k=0..n):
%p seq(a(n), n=0..70); # _Alois P. Heinz_, May 01 2013
%t 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 *)
%t 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_ *)
%o (PARI)
%o N=66; q = 'q + O('q^N);
%o Vec ( 1 + sum(k=1, N, q^k/(1-q^k) * prod(i=1,k-1, 1+q^i+q^(2*i) ) ) )
%o \\ _Joerg Arndt_, Mar 08 2014
%Y 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).
%K nonn
%O 0,3
%A _Joerg Arndt_, Apr 21 2013