OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: x*(1 + 14*x + 20*x^2 + 14*x^3 + x^4)/((1 + x)^2*(1 - x)^3).
a(n) = a(-n+1) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = 2*a(n-2) - a(n-4) + 50.
a(n) = (50*(n - 1)*n + 3*(2*n - 1)*(-1)^n + 11)/8. Therefore:
a(n) = (25*n^2 - 22*n + 4)/4 for even n;
a(n) = (25*n^2 - 28*n + 7)/4 for odd n.
MATHEMATICA
Table[(50 (n - 1) n + 3 (2 n - 1) (-1)^n + 11)/8, {n, 1, 50}]
PROG
(PARI) vector(50, n, nn; (50*(n-1)*n+3*(2*n-1)*(-1)^n+11)/8)
(PARI) Vec(x*(1 + 14*x + 20*x^2 + 14*x^3 + x^4) / ((1 - x)^3*(1 + x)^2) + O(x^50)) \\ Colin Barker, Nov 12 2018
(Sage) [(50*(n-1)*n+3*(2*n-1)*(-1)^n+11)/8 for n in (1..50)]
(Maxima) makelist((50*(n-1)*n+3*(2*n-1)*(-1)^n+11)/8, n, 1, 50);
(GAP) List([1..50], n -> (50*(n-1)*n+3*(2*n-1)*(-1)^n+11)/8);
(Magma) [(50*(n-1)*n+3*(2*n-1)*(-1)^n+11)/8: n in [1..50]];
(Python) [(50*(n-1)*n+3*(2*n-1)*(-1)**n+11)/8 for n in range(1, 50)]
(Julia) [div((50*(n-1)*n+3*(2*n-1)*(-1)^n+11), 8) for n in 1:50] |> println
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Bruno Berselli, Nov 08 2018
STATUS
approved