OFFSET
1,4
COMMENTS
Previous name: a(1) = a(2) = a(3) = 1; and for n>3 a(n) = 1*2*3*4 + 2*3*4*5 + 3*4*5*6 + ... + (n-1)*n*1*2 + n*1*2*3, the sum of the cyclic product of terms taken four at a time, final term being n*1*2*3 = 6n.
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
FORMULA
a(n) = (n+1)*(n)*(n-1)*(n-2)*(n-3)/5 + n*(n^2 - n + 6), for n>3.
From G. C. Greubel, May 05 2022: (Start)
G.f.: -5*x*(1 + 3*x + 7*x^2) + 2*x*(3 - 10*x + 15*x^2 + 4*x^4)/(1-x)^6.
E.g.f.: (1/5)*x*(30 + 10*x + 5*x^2 + 5*x^3 + x^4)*exp(x) - (5/6)*x*(6 + 9*x + 7*x^2). (End)
EXAMPLE
a(5) = 1*2*3*4 + 2*3*4*5 + 3*4*5*1 + 4*5*1*2 + 5*1*2*3 = 274.
MATHEMATICA
Table[24*Binomial[n+1, 5] +n*(n^2-n+6) -5*(2^n-1)*Boole[n<4], {n, 40}] (* G. C. Greubel, May 05 2022 *)
PROG
(PARI) a(n) = { if (n<=3, 1, (n+1)*n*(n-1)*(n-2)*(n-3)/5 +n*(n^2-n+6)) } \\ Harry J. Smith, Jul 30 2009
(SageMath) [24*binomial(n+1, 5) +n*(n^2-n+6) -5*(2^n-1)*bool(n<4) for n in (1..40)] # G. C. Greubel, May 05 2022
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Amarnath Murthy, Jun 02 2001
EXTENSIONS
More terms from Jason Earls, Jun 07 2001
Term a(4) corrected by Harry J. Smith, Jul 30 2009
Name changed by G. C. Greubel, May 05 2022
STATUS
approved