OFFSET
1,3
COMMENTS
a(4n+1) and a(4n+2) are odd, while a(4n+3) and a(4n) are even. This allows recurrence relations to be defined for this sequence for each congruence class mod 4. - Charles R Greathouse IV, Oct 09 2012
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,-1,1,0,0,0,0,1,-1,1,-1).
FORMULA
G.f.: -x*(2*x^10+3*x^8-8*x^7-2*x^6-4*x^5+2*x^4-4*x^3-4*x^2-1)/((x-1)^2*(x+1)*(x^2+1)^2*(x^4+1)). - Colin Barker, Oct 11 2012
EXAMPLE
For n = 4 ,a(n-1) = 4 , the parity are the same therefore a(4)= 4+4 = 8.
For n = 5 ,a(n-1) = 8 , the parity are opposite therefore a(5) = |5-8| = 3.
MATHEMATICA
last = 1; Join[{last}, Table[If[Mod[n - last, 2] == 0, s = n + last, s = Abs[n - last]]; last = s, {n, 2, 100}]] (* T. D. Noe, Oct 09 2012 *)
CoefficientList[Series[-(2*x^10 + 3*x^8 - 8*x^7 - 2*x^6 - 4*x^5 + 2*x^4 - 4*x^3 - 4*x^2 - 1)/((x - 1)^2*(x + 1)*(x^2 + 1)^2*(x^4 + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 28 2012 *)
PROG
(PARI) x='x+O('x^80); Vec(-x*(2*x^10+3*x^8-8*x^7-2*x^6-4*x^5+2*x^4-4*x^3 -4*x^2-1)/((x-1)^2*(x+1)*(x^2+1)^2*(x^4+1))) \\ G. C. Greubel, Aug 31 2018
(Magma) m:=80; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(-x*(2*x^10+3*x^8-8*x^7-2*x^6-4*x^5+2*x^4-4*x^3 -4*x^2-1)/((x-1)^2*(x+ 1)*(x^2+1)^2*(x^4+1)))); // G. C. Greubel, Aug 31 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kival Ngaokrajang, Oct 07 2012
STATUS
approved