OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-2,1).
FORMULA
G.f.: x*(1 - x^2 + 2*x^3)/((1-x)*(1-2*x^2-x^3+x^4)).
a(n) = 2*b(n+2) + 3*b(n+1) - b(n) - 4*b(n-1) - 2, where b(n) = A122514(n). - G. C. Greubel, Jul 11 2025
MATHEMATICA
CoefficientList[Series[(1-x^2+2 x^3)/((1-x)(1-2 x^2 -x^3 +x^4)), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 03 2017 *)
PROG
(Magma)
R<x>:= PowerSeriesRing(Integers(), 40);
Coefficients(R!( x*(1-x^2+2*x^3)/((1-x)*(1-2*x^2-x^3+x^4)) )); // G. C. Greubel, Jul 11 2025
(SageMath)
def A027010_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(1-x^2+2*x^3)/((1-x)*(1-2*x^2-x^3+x^4)) ).list()
a=A027010_list(40); a[1:] # G. C. Greubel, Jul 11 2025
(PARI) a(n)=([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; 1, -2, -1, 2, 1]^(n-1)*[1; 1; 2; 5; 6])[1, 1] \\ Charles R Greathouse IV, May 29 2026
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
STATUS
approved
