A137797 a(n) = 2*( (n+1) mod 5 ) - 2*( (n+1) mod 2 ).
0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6
Offset: 0
Examples
a(2) = 2*((2+1) mod 5) - 2*((2+1) mod 2) = 2*(3 mod 5) - 2*(3 mod 2) = 4.
Links
- Index entries for linear recurrences with constant coefficients, signature (-1,0,0,0,1,1).
Programs
-
Mathematica
LinearRecurrence[{-1,0,0,0,1,1},{0,4,4,8,-2,2},100] (* Harvey P. Dale, Jun 08 2015 *)
-
PARI
concat(0, Vec(-2*x*(3*x^3+6*x^2+4*x+2)/((x-1)*(x+1)*(x^4+x^3+x^2+x+1)) + O(x^100))) \\ Colin Barker, Dec 16 2014
Formula
a(n) = -a(n-1)+a(n-5)+a(n-6) for n>5. - Colin Barker, Dec 16 2014
G.f.: -2*x*(3*x^3+6*x^2+4*x+2) / ((x-1)*(x+1)*(x^4+x^3+x^2+x+1)). - Colin Barker, Dec 16 2014
Comments