A230075 Period 8: repeat [2, 1, 0, 1, -2, -1, 0, -1].
2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1, 0, -1, 2, 1, 0, 1, -2, -1
Offset: 0
Links
- Muniru A Asiru, Table of n, a(n) for n = 0..2000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,-1).
Programs
-
GAP
Flat(List([1..15],n->[2,1,0,1,-2,-1,0,-1])); # Muniru A Asiru, Oct 07 2018
-
Magma
&cat [[2, 1, 0, 1, -2, -1, 0, -1]^^20]; // Wesley Ivan Hurt, Oct 10 2018
-
Maple
A230075:=n->sqrt((n+2)^2 mod 8)*(-1)^floor(n/4); seq(A230075(n), n=0..100); # Wesley Ivan Hurt, Jan 01 2014
-
Mathematica
Table[Sqrt[Mod[(n+2)^2, 8]](-1)^Floor[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 01 2014 *)
-
PARI
a(n)=[2, 1, 0, 1, -2, -1, 0, -1][n%8+1] \\ Charles R Greathouse IV, Jul 17 2016
Formula
O.g.f.: (2 + x + x^3) / (1 + x^4).
a(n) = 2*(-1)^(n/4) if n == 0 (mod 4); a(n) == 0 if n == 2 (mod 4); a(n) = (-1)^((n-1)/4) if n == 1 (mod 4); a(n) == (-1)^((n-3)/4) if n == 3 (mod 4).
a(n) = Product_{l=0..floor((n-2)/2)} 2*cos((2*l+1)*Pi/2). Proof via the product formulas for the four (mod 4) cases; see the comments for subsequences like A033999, and the product of the zeros of Chebyshev S-polynomials (A049310) from S(n-1, 0) which is known.
a(n) = sqrt((n+2)^2 mod 8)*(-1)^floor(n/4). - Wesley Ivan Hurt, Jan 01 2014
a(n) = (cos(Pi*(2*n+q-r-s)/8)-cos(Pi*(-2*n+q+r-s)/8)+sin(Pi*(-2*n+q-r+s)/8)+3*sin(Pi*(2*n+q+r+s)/8))/2 where q = 1+(-1)^n, r = 2*sin(n*Pi/2) and s = 2*cos(n*Pi/2). - Wesley Ivan Hurt, Oct 06 2018
Comments