This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A230074 #47 Sep 08 2022 08:46:06 %S A230074 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, %T A230074 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, %U A230074 -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 %N A230074 Period 4: repeat [1, -2, 1, 0]. %C A230074 The o.g.f. for this sequence is obtained from the o.g.f.'s of the bisection of the sequence including a(0) = 0. %C A230074 For the cos product formula below use Product_{k=1..n-1} 2*cos(2*k*Pi/n) = 1 if n is odd, and Product_{k=1..n-1} 2*cos(2*k*Pi/n) = -(1-(-1)^(n/2)) if n is even (see Gradstein-Rhyzik, p.62, 1.393 1., with x=0). %C A230074 Also, the arithmetic function uhat(n,4,4) as defined in A291041. - _Robert Price_, Aug 25 2017 %D A230074 I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981. %H A230074 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,-1). %F A230074 a(n) = 1 if n is odd, and a(n) = -(1-(-1)^(n/2)) if n is even. %F A230074 a(n+4*k) = a(n), n = 1, 2, 3, 4, k >= 1. %F A230074 G.f.: -2*x/(1-x^4) + 1/(1-x^2) = (1-x)/((1+x)*(1+x^2)). %F A230074 a(n) = Product_{k=1..n-1} 2*cos(2*k*Pi/n). %F A230074 a(n) = sqrt(n^2 mod 8)*(-1)^(n+1). - _Wesley Ivan Hurt_, Jan 01 2014 %F A230074 From _Wesley Ivan Hurt_, Jun 22 2015: (Start) %F A230074 a(n) + a(n-1) + a(n-2) + a(n-3) = 0, n>3. %F A230074 a(n) = (1+(-1)^n)*(-1)^(n/2)/2-(-1)^n. (End) %F A230074 From _Wesley Ivan Hurt_, Jul 09 2016: (Start) %F A230074 a(n) = a(n-4) for n>4. %F A230074 a(n) = cos(n*Pi/2) - (-1)^n. (End) %F A230074 E.g.f.: cos(x) - exp(-x). - _Ilya Gutkovskiy_, Jul 09 2016 %F A230074 From _Werner Schulte_, Aug 29 2020: (Start) %F A230074 Multiplicative with a(2^e) = (-2)^e if e<2 and 0 if e>1, and a(p^e) = 1 for prime p > 2. %F A230074 Dirichlet g.f.: zeta(s) * (1-2^(-s)) * (1-2^(1-s)). %F A230074 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) %p A230074 A230074:=n->sqrt(n^2 mod 8)*(-1)^(n+1); seq(A230074(n), n=1..100); # _Wesley Ivan Hurt_, Jan 01 2014 %t A230074 Table[Sqrt[Mod[n^2, 8]](-1)^(n+1), {n, 100}] (* _Wesley Ivan Hurt_, Jan 01 2014 *) %t A230074 PadRight[{},120,{1,-2,1,0}] (* _Harvey P. Dale_, Apr 17 2014 *) %o A230074 (Magma) &cat [[1, -2, 1, 0]^^30]; // _Wesley Ivan Hurt_, Jul 09 2016 %o A230074 (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 %Y A230074 Cf. A291041. %K A230074 sign,easy,mult %O A230074 1,2 %A A230074 _Wolfdieter Lang_, Oct 21 2013