A331321 a(n) = [x^n] ((x^2 - 1)*(x^2 + x - 1))/(x^2 + 2*x - 1)^2.
1, 3, 8, 23, 64, 175, 472, 1259, 3328, 8731, 22760, 59007, 152256, 391239, 1001656, 2556115, 6503936, 16505651, 41788616, 105571303, 266181440, 669923039, 1683255448, 4222878651, 10579130112, 26467818315, 66138242984, 165077936207, 411584855488, 1025162759287
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (4,-2,-4,-1).
Programs
-
Magma
R
:=PowerSeriesRing(Integers(), 33); Coefficients(R!( (1 - x)*(1 + x)*(1-x-x^2) / (1-2*x-x^2)^2 )); // Marius A. Burtea, Jan 15 2020 -
Maple
gf := ((x^2 - 1)*(x^2 + x - 1))/(x^2 + 2*x - 1)^2: ser := series(gf, x, 32): seq(coeff(ser, x, n), n=0..29);
-
Mathematica
LinearRecurrence[{4,-2,-4,-1},{1,3,8,23,64},40] (* Harvey P. Dale, Feb 01 2022 *)
-
PARI
Vec((1 - x)*(1 + x)*(1 - x - x^2) / (1 - 2*x - x^2)^2 + O(x^30)) \\ Colin Barker, Jan 14 2020
Formula
a(n) = Sum_{k=0..n} A193737(n, k)*(1 + k).
Let h(k) = (1 + k)*exp((1 + k)*x)*(2*x + 10 - 5*k)/8 then
a(n) = n!*[x^n](h(sqrt(2)) + h(-sqrt(2)) + 1).
From Colin Barker, Jan 14 2020: (Start)
a(n) = 4*a(n-1) - 2*a(n-2) - 4*a(n-3) - a(n-4) for n>4.
a(n) = (-5*sqrt(2)*((1-sqrt(2))^n - (1+sqrt(2))^n) + 2*((1-sqrt(2))^n + (1+sqrt(2))^n)*n) / 8 for n>0.
(End)