OFFSET
1,1
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
a(n) = (2n - 1 - ((n+1) mod 2))^2 + (2n + (n mod 2))^2.
From Colin Barker, Nov 10 2016: (Start)
G.f.: 2*x*(5 + 5*x + 17*x^2 + 3*x^3 + 2*x^4) / ((1 - x)^3 * (1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>5.
a(n) = 8*n^2 - 8*n + 4 for n even.
a(n) = 8*n^2 + 2 for n odd.
(End)
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {10, 20, 74, 100, 202}, 50] (* Harvey P. Dale, Mar 02 2023 *)
PROG
(PARI) Vec(2*x*(5+5*x+17*x^2+3*x^3+2*x^4) / ((1-x)^3*(1+x)^2) + O(x^60)) \\ Colin Barker, Nov 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Edwin McCravy, Nov 06 2016
STATUS
approved