OFFSET
0,2
COMMENTS
a(n) is the sum of consecutive strings of positive integers of length 2*n, starting with the integer 2; and a(0) = 1.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
From Colin Barker, Aug 14 2017: (Start)
G.f.: (1 + x + 8*x^2 + x^3 + x^4) / (1 - x)^4.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n > 4.
(End)
EXAMPLE
a(1) = 5 = 2 + 3;
a(2) = 22 = 4 + 5 + 6 + 7;
a(3) = 63 = 8 + 9 + 10 + 11 + 12 + 13.
MATHEMATICA
Table[Boole[n == 0] + n (2 n^2 + 3), {n, 0, 41}] (* or *)
CoefficientList[Series[(1 + x + 8 x^2 + x^3 + x^4)/(1 - x)^4, {x, 0, 41}], x] (* Michael De Vlieger, Aug 15 2017 *)
LinearRecurrence[{4, -6, 4, -1}, {1, 5, 22, 63, 140}, 50] (* Harvey P. Dale, Jul 12 2022 *)
PROG
(PARI) a(n) = if (n==0, 1, n*(2*n^2 + 3)); \\ Michel Marcus, Aug 14 2017
(PARI) Vec((1 + x + 8*x^2 + x^3 + x^4) / (1 - x)^4 + O(x^60)) \\ Colin Barker, Aug 14 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Aug 12 2017
STATUS
approved