OFFSET
1,2
COMMENTS
Equals row sums of triangle A177991. - Gary W. Adamson, May 16 2010
Positive numbers that are either triangular (A000217) or triangular minus 1 (A000096). - Jon E. Schoenfield, Jun 12 2010
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Jonathan Bloom and Nathan McNew, Counting pattern-avoiding integer partitions, arXiv:1908.03953 [math.CO], 2019.
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: Sum_{k>=1} x^k/((1 - x^k)*(1 - x^(k + 1))*(1 - x^(k + 2))). More generally, the g.f. of the number of partitions in which any two parts differ by at most b is Sum_{k>=1} (x^k/(Product_{j=k..k+b} 1 - x^j)).
a(n) = (2*n^2 + 10*n + 3 + (-1)^n * (2*n - 3))/16. - Birkas Gyorgy, Feb 20 2011
G.f.: (1 + x)/(1 - x)/(Q(0) - x^2 - x^3), where Q(k) = 1 + x^2 + x^3 + k*x*(1 + x^2) - x^2*(1 + x*(k + 2))*(1 + k*x)/Q(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Jan 05 2014
G.f.: x*(1 + x - x^2)/((1 - x)^3*(1 + x)^2). - Colin Barker, Mar 05 2015
E.g.f.: (1/16)*( (3 + 2*x)*exp(-x) + (3 + 12*x + 2*x^2)*exp(x) ). - G. C. Greubel, Jul 18 2023
EXAMPLE
a(6) = 9 because we have
1: [6],
2: [4, 2],
3: [3, 3],
4: [3, 2, 1],
5: [3, 1, 1, 1],
6: [2, 2, 2],
7: [2, 2, 1, 1],
8: [2, 1, 1, 1, 1],
9: [1, 1, 1, 1, 1, 1]
([5,1] and [4,1,1] do not qualify).
MAPLE
g:=sum(x^k/(1-x^k)/(1-x^(k+1))/(1-x^(k+2)), k=1..75): gser:=series(g, x=0, 70): seq(coeff(gser, x^n), n=1..65); with(combinat): for n from 1 to 7 do P:=partition(n): A:={}: for j from 1 to nops(P) do if P[j][nops(P[j])]-P[j][1]<3 then A:=A union {P[j]} else A:=A fi od: print(A); od: # this program yields the partitions
MATHEMATICA
Table[Count[IntegerPartitions[n], _?(Max[#] - Min[#] <= 2 &)], {n, 30}] (* Birkas Gyorgy, Feb 20 2011 *)
Table[(2*n^2 +10*n +3 +(-1)^n*(2*n-3))/16, {n, 30}] (* Birkas Gyorgy, Feb 20 2011 *)
Table[Sum[If[EvenQ[k], 1, (k+1)/2], {k, 0, n}], {n, 0, 60}] (* Jon Maiga, Dec 21 2018 *)
PROG
(PARI) Vec(x*(x^2-x-1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
(GAP) List([1..60], n->(2*n^2+10*n+3+(-1)^n*(2*n-3))/16); # Muniru A Asiru, Dec 21 2018
(Magma) [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16: n in [1..60]]; // G. C. Greubel, Jul 18 2023
(SageMath) [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16 for n in range(1, 61)] # G. C. Greubel, Jul 18 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Feb 27 2006
STATUS
approved