OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-5,5,1,-3,1).
FORMULA
For n>1, a(n) = (1/16)*(n^4 + 30*n^3 + 246*n^2 + 476*n + 256 + (1 if n odd, 0 if n even)*(6*n + 9)).
G.f.: -x*(63*x^7-173*x^6+15*x^5+335*x^4-228*x^3-157*x^2+150*x+1) / ((x-1)^5*(x+1)^2). - Colin Barker, Nov 26 2012
MATHEMATICA
Join[{1, 153}, LinearRecurrence[{3, -1, -5, 5, 1, -3, 1}, {301, 517, 825, 1234, 1774, 2454, 3310}, 49]] (* G. C. Greubel, Jun 27 2018 *)
PROG
(PARI) x='x+O('x^30); Vec(-x*(63*x^7-173*x^6+15*x^5 +335*x^4 -228*x^3 - 157*x^2+150*x+1)/((x-1)^5*(x+1)^2)) \\ G. C. Greubel, Jun 27 2018
(Magma) I:=[301, 517, 825, 1234, 1774, 2454, 3310]; [1, 153] cat [n le 7 select I[n] else 3*Self(n-1) -Self(n-2) -5*Self(n-3) +5*Self(n-4) + Self(n-5) -3*Self(n-6) +Self(n-7): n in [1..30]]; // G. C. Greubel, Jun 27 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Pasino, Apr 09 2009
STATUS
approved