login

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”).

Period 4: repeat [1, -3, 1, 1].
1

%I #41 Dec 12 2023 07:40:18

%S 1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,

%T 1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,

%U -3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1,-3,1,1,1

%N Period 4: repeat [1, -3, 1, 1].

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,-1).

%F Sum_{k>=0} a(k)/(k+1) = 0.

%F a(n) = cos(n*Pi) - 2*sin(n*Pi/2).

%F G.f.: (1-2*x-x^2)/((1+x)*(1+x^2)).

%F a(n) = -a(n-1) -a(n-2) -a(n-3) for n>2. [_R. J. Mathar_, Apr 28 2010]

%F a(n) = 1-(1-(-1)^n)*(1-I^(n+1)). - _Bruno Berselli_, Mar 16 2011

%F Dirichlet generating function: Zeta(s)*(1 - 1/2^(s - 1))^2. [_Mats Granvik_ and _Jaume Oliver Lafont_, Mar 12 2014]

%F a(n) = a(n-4) for n>3. - _Wesley Ivan Hurt_, Jul 07 2016

%F E.g.f.: exp(-x) - 2*sin(x). - _Ilya Gutkovskiy_, Jul 07 2016

%p seq(op([1, -3, 1, 1]), n=0..50); # _Wesley Ivan Hurt_, Jul 07 2016

%t PadRight[{}, 100, {1, -3, 1, 1}] (* _Wesley Ivan Hurt_, Jul 07 2016 *)

%o (PARI) a(n)=[1,-3,1,1][n%4+1]

%o (Magma) &cat [[1, -3, 1, 1]^^30]; // _Wesley Ivan Hurt_, Jul 07 2016

%K sign,easy

%O 0,2

%A _Jaume Oliver Lafont_, Apr 20 2010