A100286 Expansion of (1+2*x^2-2*x^3+2*x^4)/(1-x+x^2-x^3+x^4-x^5).
1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..5000
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1).
Programs
-
Magma
[2 +(n mod 2)*(1-((n+2) mod 3)) -((n+1) mod 3): n in [0..100]]; // G. C. Greubel, Feb 06 2023
-
Mathematica
CoefficientList[Series[(1+2x^2-2x^3+2x^4)/(1-x+x^2-x^3+x^4-x^5),{x,0,100}],x] (* Harvey P. Dale, Mar 03 2019 *) PadRight[{}, 120, {1,1,2,0,0,2}] (* G. C. Greubel, Feb 06 2023 *)
-
SageMath
def A100286(n): return 2 +(n%2)*(1-((n-1)%3)) -((n+1)%3) [A100286(n) for n in range(101)] # G. C. Greubel, Feb 06 2023
Formula
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5).
a(n) = (1/6)*(6 + 3*cos(Pi*n/3) - 3*cos(2*Pi*n/3) + sqrt(3)*sin(Pi*n/3) - 3*sqrt(3)*sin(2*Pi*n/3)).
a(n) = mod(A100284(n), 3).
From G. C. Greubel, Feb 06 2023: (Start)
a(n) = a(n-6).
a(n) = 2 + (n mod 2)*(1 - (n-1 mod 3)) - (n+1 mod 3). (End)
a(n) = 1 + A131736(n). - Elmo R. Oliveira, Jun 20 2024
Comments