login
Period 2: repeat (0,4).
1

%I #27 Sep 08 2022 08:44:37

%S 0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,

%T 0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,

%U 0,4,0,4,0,4,0,4,0,4,0,4,0

%N Period 2: repeat (0,4).

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

%F a(n) = 2*(1-(-1)^n); a(n) = 4*(n mod 2) - _Paolo P. Lava_, Oct 20 2006

%F O.g.f.: -2/(1+x)-2/(x-1). - _R. J. Mathar_, Feb 19 2008

%F a(n) = 4*(1+floor((n+1)/2)-ceiling((n+1)/2)). - _Wesley Ivan Hurt_, May 21 2013

%F a(n) = 4*cos( Pi*(n+1)/2 )^2. - _Wesley Ivan Hurt_, May 21 2013

%o (Magma) &cat [[0,4]^^50]; // _Bruno Berselli_, Dec 10 2015

%o (PARI) a(n)=n%2*4 \\ _Charles R Greathouse IV_, Jul 23 2016

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_.