A230074 Period 4: repeat [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
Offset: 1
References
- I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981.
Links
- Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1).
Crossrefs
Cf. A291041.
Programs
-
Magma
&cat [[1, -2, 1, 0]^^30]; // Wesley Ivan Hurt, Jul 09 2016
-
Maple
A230074:=n->sqrt(n^2 mod 8)*(-1)^(n+1); seq(A230074(n), n=1..100); # Wesley Ivan Hurt, Jan 01 2014
-
Mathematica
Table[Sqrt[Mod[n^2, 8]](-1)^(n+1), {n, 100}] (* Wesley Ivan Hurt, Jan 01 2014 *) PadRight[{},120,{1,-2,1,0}] (* Harvey P. Dale, Apr 17 2014 *)
-
PARI
a(n)=([0,1,0; 0,0,1; -1,-1,-1]^(n-1)*[1;-2;1])[1,1] \\ Charles R Greathouse IV, Jul 17 2016
Formula
a(n) = 1 if n is odd, and a(n) = -(1-(-1)^(n/2)) if n is even.
a(n+4*k) = a(n), n = 1, 2, 3, 4, k >= 1.
G.f.: -2*x/(1-x^4) + 1/(1-x^2) = (1-x)/((1+x)*(1+x^2)).
a(n) = Product_{k=1..n-1} 2*cos(2*k*Pi/n).
a(n) = sqrt(n^2 mod 8)*(-1)^(n+1). - Wesley Ivan Hurt, Jan 01 2014
From Wesley Ivan Hurt, Jun 22 2015: (Start)
a(n) + a(n-1) + a(n-2) + a(n-3) = 0, n>3.
a(n) = (1+(-1)^n)*(-1)^(n/2)/2-(-1)^n. (End)
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = a(n-4) for n>4.
a(n) = cos(n*Pi/2) - (-1)^n. (End)
E.g.f.: cos(x) - exp(-x). - Ilya Gutkovskiy, Jul 09 2016
From Werner Schulte, Aug 29 2020: (Start)
Multiplicative with a(2^e) = (-2)^e if e<2 and 0 if e>1, and a(p^e) = 1 for prime p > 2.
Dirichlet g.f.: zeta(s) * (1-2^(-s)) * (1-2^(1-s)).
Dirichlet inverse b(n) is multiplicative with b(2^e) = 2^e and, for prime p>2, b(p^e) = (-1)^e if e<2 and 0 if e>1. (End)
Comments