OFFSET
0,2
COMMENTS
LINKS
Daniel Poveda Parrilla, Table of n, a(n) for n = 0..10000
Daniel Poveda Parrilla, Illustration of initial terms
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = 4*n*(2*n + (-1)^n) + 1.
a(n) = 4*n*(2*n + 1) + 1 for n even.
a(n) = 4*n*(2*n - 1) + 1 for n odd.
a(n) is sum of two squares; a(n) = k^2 + (k+1)^2 where k = 2n-(n mod 2). - David A. Corneth, Sep 27 2016
From Colin Barker, Sep 27 2016: (Start)
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 4.
G.f.: (1+4*x+34*x^2+12*x^3+13*x^4) / ((1-x)^3*(1+x)^2). (End)
E.g.f.: (1+8*x+8*x^2)*exp(x) - 4*x*exp(-x). - G. C. Greubel, Aug 19 2022
MAPLE
MATHEMATICA
Table[4 n (2 n + (-1)^n) + 1, {n, 0, 44}] (* or *)
CoefficientList[Series[(1 +4x +34x^2 +12x^3 +13x^4)/((1-x)^3*(1+x)^2), {x, 0, 44}], x] (* Michael De Vlieger, Sep 28 2016 *)
PROG
(PARI) Vec((1+4*x+34*x^2+12*x^3+13*x^4)/((1-x)^3*(1+x)^2) + O(x^50)) \\ Colin Barker, Sep 27 2016
(Magma) [4*n*(2*n+(-1)^n)+1 : n in [0..60]]; // Wesley Ivan Hurt, Sep 27 2016
(SageMath) [4*n*(2*n+(-1)^n) +1 for n in (0..60)] # G. C. Greubel, Aug 19 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Daniel Poveda Parrilla, Sep 27 2016
STATUS
approved