A176895 Period 4: repeat [1, 4, 2, 4].
1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1, 4, 2, 4, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Crossrefs
Cf. A056594.
Programs
-
Magma
&cat [[1, 4, 2, 4]^^30]; // Wesley Ivan Hurt, Jul 11 2016
-
Maple
seq(op([1, 4, 2, 4]), n=0..50); # Wesley Ivan Hurt, Jul 11 2016
-
Mathematica
PadRight[{}, 100, {1, 4, 2, 4}] (* Wesley Ivan Hurt, Jul 11 2016 *)
-
PARI
a(n)=4/gcd(n,4) \\ Charles R Greathouse IV, Oct 07 2015
Formula
a(n) = 4/gcd(n,4). - Michael Somos, Jan 06 2011
a(n) = 4-(1+(-1)^n)*(5+I^n)/4. - Bruno Berselli, Mar 22 2011
G.f.: ( 1+4*x+2*x^2+4*x^3 ) / ( (1-x)*(1+x)*(x^2+1) ). - R. J. Mathar, Mar 21 2011
From Wesley Ivan Hurt, Jul 11 2016: (Start)
a(n) = a(n-4) for n>3.
a(n) = 2^((5-(-I)^n-I^n-3*I^(2*n))/4) where I=sqrt(-1). (End)