A234044 Period 7: repeat [2, -2, 1, 0, 0, 1, -2].
2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2, 1, 0, 0, 1, -2, 2, -2
Offset: 0
Examples
n = 4: 2*exp(8*Pi*I/7) = (2-16*x^2+20*x^4-8*x^6+x^8) + (4*x+10*x^3-6*x^5+x^7)*s(7)*I, reduced with C(7, x) = x^3 - x^2 - 2*x + 1 = 0 this becomes = (-x) + (-1)*s(7)*I with x= 2*cos(Pi/7) and s(7) = 2*sin(Pi/7).The power basis coefficients are thus (a(4), b(4), c(4)) = (0, -1, 0) and (A(4), B(4), C(4)) = (-1, 0, 0).
Links
- Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1,-1,-1,-1).
Crossrefs
Programs
-
Magma
&cat [[2, -2, 1, 0, 0, 1, -2]^^20]; // Wesley Ivan Hurt, Jul 16 2016
-
Maple
seq(op([2, -2, 1, 0, 0, 1, -2]), n=0..20); # Wesley Ivan Hurt, Jul 16 2016
-
Mathematica
PadRight[{}, 100, {2, -2, 1, 0, 0, 1, -2}] (* Wesley Ivan Hurt, Jul 16 2016 *)
-
PARI
a(n)=[2, -2, 1, 0, 0, 1, -2][n%7+1] \\ Charles R Greathouse IV, Jul 17 2016
Formula
G.f.: (2 - 2*x + x^2 + x^5 - 2*x^6)/(1 - x^7).
a(n+7) = a(n) for n>=0, with a(0) = -a(1) = -a(6) = 2, a(3) = a(4) =0 and a(2) = a(5) = 1.
From Wesley Ivan Hurt, Jul 16 2016: (Start)
a(n) + a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5) + a(n-6) = 0 for n>5.
a(n) = (1/7) * Sum_{k=1..6} 2*cos((2k)*n*Pi/7) - 2*cos((2k)*(1+n)*Pi/7) + cos((2k)*(2+n)*Pi/7) + cos((2k)*(5+n)*Pi/7) - 2*cos((2k)*(6+n)*Pi/7).
a(n) = 2 + 4*floor(n/7) - 3*floor((1+n)/7) + floor((2+n)/7) - floor((4+n)/7) + 3*floor((5+n)/7) - 4*floor((6+n)/7). (End)
Comments