A132400 Period 4: repeat [1, 5, 3, 1].
1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1, 1, 5, 3, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Crossrefs
Cf. A082311.
Programs
-
Magma
&cat [[1, 5, 3, 1]^^30]; // Wesley Ivan Hurt, Jul 09 2016
-
Maple
seq(op([1, 5, 3, 1]), n=0..40); # Wesley Ivan Hurt, Jul 09 2016
-
Mathematica
PadRight[{}, 120, {1,5,3,1}] (* Harvey P. Dale, Sep 15 2014 *)
-
PARI
a(n)=[1,5,3,1][n%4+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
Final digits of A082311.
O.g.f.: (1+5*x+3*x^2+x^3)/((1-x)*(x+1)*(1+x^2)) = (5/2)/(1-x)-(1/2)/(x+1)+(2*x-1)/(1+x^2). - R. J. Mathar, Nov 28 2007
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = a(n-4) for n>3.
a(n) = (5-cos(n*Pi)-2*cos(n*Pi/2)+4*sin(n*Pi/2)-I*sin(n*Pi))/2. (End)