A218507 Number of partitions of n in which any two parts differ by at most 5.
1, 1, 2, 3, 5, 7, 11, 15, 21, 28, 37, 48, 62, 78, 98, 121, 149, 181, 219, 262, 313, 370, 436, 510, 595, 690, 797, 916, 1050, 1198, 1364, 1545, 1747, 1968, 2212, 2479, 2771, 3089, 3437, 3814, 4226, 4669, 5151, 5670, 6232, 6837, 7487, 8185, 8936, 9739, 10602
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,0,0,0,-2,-2,1,1,2,1,1,-2,-2,0,0,0,1,1,-1).
Crossrefs
Column k=5 of A194621.
Programs
-
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, 5), i=1..n): seq(a(n), n=0..80);
-
Mathematica
LinearRecurrence[{1,1,0,0,0,-2,-2,1,1,2,1,1,-2,-2,0,0,0,1,1,-1},{1,1,2,3,5,7,11,15,21,28,37,48,62,78,98,121,149,181,219,262,313},60] (* Harvey P. Dale, Jan 18 2016 *)
-
PARI
Vec((x^20-x^19-x^18+x^15+x^14+x^13-x^12-x^11-x^10+x^7+x^6-x^5+1)/((x-1)^6*(x+1)^2*(x^2+1)*(x^2+x+1)*(x^4+x^3+x^2+x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
Formula
G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..5} (1-x^(i+j)).
G.f.: (x^20 -x^19 -x^18 +x^15 +x^14 +x^13 -x^12 -x^11 -x^10 +x^7 +x^6 -x^5 +1) / ((x -1)^6*(x +1)^2*(x^2 +1)*(x^2 +x +1)*(x^4 +x^3 +x^2 +x +1)^2). - Colin Barker, Mar 05 2015