OFFSET
0,3
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Brian Hopkins and Stéphane Ouvry, Combinatorics of Multicompositions, arXiv:2008.04937 [math.CO], 2020.
E. Kilic and D. Tasci, The generalized Binet formula, representation and sums of the generalizedorder-k Pell numbers, Taiwanese J of Math vol 10 no 6 (2006), 1661-1670.
Index entries for linear recurrences with constant coefficients, signature (2,1,1,1,1).
FORMULA
From R. J. Mathar, Nov 28 2008: (Start)
a(n) = 2*a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5).
G.f.: x/(1-2*x-x^2-x^3-x^4-x^5). (End)
a(n+1) = Sum_(k=1..n, Sum_(r=0..k, binomial(k,r)*2^(k-r)*Sum_(m=0..r,(Sum_(j=0..m, binomial(j,-r+n-m-k-j)*binomial(m,j)))*binomial(r,m)))), a(0)=0, a(1)=1. [Vladimir Kruchinin, May 05 2011]
MAPLE
P := proc(n, k, i) option remember ; if n = 1-i then 1; elif n <= 0 then 0; else 2*P(n-1, k, i)+add(P(n-j, k, i), j=2..k) ; fi ; end: for n from 0 to 40 do printf("%d, ", P(n, 5, 5)) ; od:
MATHEMATICA
CoefficientList[Series[x/(1 - 2*x - x^2 - x^3 - x^4 - x^5), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 13 2012 *)
LinearRecurrence[{2, 1, 1, 1, 1}, {0, 1, 2, 5, 13}, 40] (* Harvey P. Dale, Jan 08 2016 *)
PROG
(Maxima)
a(n):=b(n+1);
b(n):=sum(sum(binomial(k, r)*2^(k-r)*sum((sum(binomial(j, -r+n-m-k-j)*binomial(m, j), j, 0, m))*binomial(r, m), m, 0, r), r, 0, k), k, 1, n); /* Vladimir Kruchinin, May 05 2011 */
(Magma) I:=[0, 1, 2, 5, 13]; [n le 5 select I[n] else 2*Self(n-1)+Self(n-2)+Self(n-3)+Self(n-4)+Self(n-5): n in [1..30]]; // Vincenzo Librandi, Dec 13 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. J. Mathar, Aug 07 2008
STATUS
approved