OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..2500
Index entries for linear recurrences with constant coefficients, signature (2,-3,4,-3,2,-1)
FORMULA
a(4*n) = 27*n, a(4*n + 1) = 24*n + 1, a(4*n + 2) = 3*n - 1, a(4*n - 1) = 6*n + 1.
0 = a(n)*(+a(n+1) + 2*a(n+2) - a(n+3)) + a(n+1)*(-2*a(n+1) + 3*a(n+2) + 2*a(n+3)) + a(n+2)*(-2*a(n+2) + a(n+3)) for all n in Z.
EXAMPLE
G.f. = x - x^2 + 7*x^3 + 27*x^4 + 25*x^5 + 2*x^6 + 13*x^7 + 54*x^8 + ...
MATHEMATICA
CoefficientList[Series[(x-3*x^2+12*x^3+6*x^4-x^5)/((1-x)*(1+x^2))^2, {x, 0, 60}], x] (* G. C. Greubel, Aug 06 2018 *)
PROG
(PARI) {a(n) = my(m = n\4); [27*m, 24*m + 1, 3*m - 1, 6*m + 7][n%4 + 1]};
(PARI) {a(n) = polcoeff( if( n<0, (x - 6*x^2 - 12*x^3 + 3*x^4 - x^5), (x - 3*x^2 + 12*x^3 + 6*x^4 - x^5)) / ((1 - x) * (1 + x^2))^2 + x * O(x^abs(n)), abs(n))};
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((x-3*x^2+12*x^3+6*x^4-x^5)/((1-x)*(1+x^2))^2)); // G. C. Greubel, Aug 06 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Michael Somos, Aug 17 2014
STATUS
approved