login
A218506
Number of partitions of n in which any two parts differ by at most 4.
4
1, 1, 2, 3, 5, 7, 11, 14, 20, 25, 34, 41, 54, 64, 81, 95, 118, 136, 165, 189, 226, 256, 301, 339, 395, 441, 507, 564, 644, 711, 804, 885, 995, 1089, 1215, 1326, 1473, 1600, 1766, 1914, 2105, 2272, 2486, 2678, 2921, 3136, 3406, 3650, 3954, 4225, 4560, 4865
OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,0,1,-3,-1,0,1,3,-1,0,-1,-1,1).
FORMULA
G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..4} (1-x^(i+j)).
G.f.: (x^14-x^13-x^12+2*x^9-x^6-x^5+x^4-1) / ((x-1)^5*(x+1)^3*(x^2+1)^2*(x^2+x+1)). - Colin Barker, Mar 05 2015
MAPLE
b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
`if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
end:
a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 4), i=1..n):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 4], {i, 1, n}];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)
PROG
(PARI) Vec((x^14-x^13-x^12+2*x^9-x^6-x^5+x^4-1)/((x-1)^5*(x+1)^3*(x^2+1)^2*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Mar 05 2015
CROSSREFS
Column k=4 of A194621.
Sequence in context: A309098 A136185 A319471 * A238659 A341870 A234666
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Oct 31 2012
STATUS
approved