Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #17 Sep 08 2022 08:46:06
%S 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,
%T 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,
%U 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
%N Period 7: repeat [2, -2, 1, 0, 0, 1, -2].
%C This is a member of the six sequences which appear for the instance N=7 of the general formula 2*exp(2*Pi*n*I/N) = R(n, x^2-2) + x*S(n-1, x^2-2)*s(N)*I, for n >= 0, with I = sqrt(-1), s(N) = sqrt(2-x)*sqrt(2+x), x = rho(N) := 2*cos(Pi/N) and R and S are the monic Chebyshev polynomials whose coefficient tables are given in A127672 and A049310. If powers x^k with k >= delta(N) = A055034(N) enter in R or x*S then C(N, x), the minimal polynomial of x = rho(N) (see A187360) is used for a reduction. If delta(N) = 2 it may happen that sqrt(2+x) or sqrt(2-x) is an integer in the number field Q(rho(N)). See the N=5 case comment on A164116.
%C For N=7 with delta(7) = 3, and C(7, x) = x^3 - x^2 - 2*x + 1 the final result becomes 2*exp(2*Pi*n*I/7) = (a(n) + b(n)*x + c(n)*x^2) + (A(n) + B(n)*x + C(n)*x^2)*s(7)*I, with x = rho(7) = 2*cos(Pi/7), a(n) the present sequence, b(n) = A234045(n), c(n) = A234046(n), A(n) = A238468(n), B(n) = A238469(n) and C(n) = A238470(n). The a, b, c and A, B, C brackets are integers in Q(rho(7)).
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,-1,-1,-1,-1).
%F G.f.: (2 - 2*x + x^2 + x^5 - 2*x^6)/(1 - x^7).
%F 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.
%F From _Wesley Ivan Hurt_, Jul 16 2016: (Start)
%F a(n) + a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5) + a(n-6) = 0 for n>5.
%F 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).
%F 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)
%e 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).
%p seq(op([2, -2, 1, 0, 0, 1, -2]), n=0..20); # _Wesley Ivan Hurt_, Jul 16 2016
%t PadRight[{}, 100, {2, -2, 1, 0, 0, 1, -2}] (* _Wesley Ivan Hurt_, Jul 16 2016 *)
%o (Magma) &cat [[2, -2, 1, 0, 0, 1, -2]^^20]; // _Wesley Ivan Hurt_, Jul 16 2016
%o (PARI) a(n)=[2, -2, 1, 0, 0, 1, -2][n%7+1] \\ _Charles R Greathouse IV_, Jul 17 2016
%Y Cf. A234045, A234046, A238468, A238469, A238470, A099837 (N=3), A056594 (N=4), A164116 (N=5), A057079 (N=6).
%K sign,easy
%O 0,1
%A _Wolfdieter Lang_, Feb 27 2014