A143025 Period length 4: repeat [1, 8, 2, 8].
1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8, 2, 8, 1, 8
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Programs
-
Magma
&cat [[1, 8, 2, 8]^^30]; // Wesley Ivan Hurt, Jul 10 2016
-
Maple
seq(op([1, 8, 2, 8]), n=0..50); # Wesley Ivan Hurt, Jul 10 2016
-
Mathematica
PadRight[{}, 120, {1, 8, 2, 8}] (* Harvey P. Dale, Jul 01 2015 *)
-
PARI
a(n)=[1,8,2,8][n%4+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
a(n+4) = a(n).
G.f.: (1+8*x+2*x^2+8*x^3)/(1-x^4).
From Wesley Ivan Hurt, Jul 10 2016: (Start)
a(n) = (19 - 13*I^(2*n) - I^(-n) - I^n)/4, where I = sqrt(-1).
a(n) = (19 - 2*cos(n*Pi/2) - 13*cos(n*Pi))/4. (End)
Extensions
Partially edited by R. J. Mathar, Dec 10 2008
Comments