A165207 Period 4: repeat [2, 2, 4, 4].
2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1).
Programs
-
Magma
&cat[[2,2,4,4]^^30]; // Vincenzo Librandi, Feb 08 2016
-
Maple
seq(op([2, 2, 4, 4]), n=0..50); # Wesley Ivan Hurt, Jul 09 2016
-
Mathematica
PadRight[{}, 120, {2,2,4,4}] (* Harvey P. Dale, Oct 08 2014 *)
-
PARI
a(n)=n\2*2%4 + 2 \\ Charles R Greathouse IV, Jul 17 2016
Formula
a(n) = 2*A130658(n).
From R. J. Mathar, Sep 11 2009: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
G.f.: 2*(1+2*x^2)/((1-x)*(1+x^2)). (End)
a(n) = 3-cos(Pi*n/2)-sin(Pi*n/2). - R. J. Mathar, Oct 08 2011
a(n) = 2 + (2*floor(n/2) mod 4). - Wesley Ivan Hurt, Apr 20 2015
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 09 2016
Extensions
Edited, offset set to 0, by R. J. Mathar, Sep 11 2009
Comments