A130815 Period 6: repeat [1, 5, 4, -1, -5, -4].
1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4, 1, 5, 4, -1, -5, -4
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-1).
Crossrefs
Cf. A010892.
Programs
-
Magma
&cat[[1, 5, 4, -1, -5, -4]: n in [0..20]]; // Wesley Ivan Hurt, Jun 17 2016
-
Mathematica
Flatten[Table[{1, 5, 4, -1, -5, -4}, {20}]] (* Wesley Ivan Hurt, Jun 17 2016 *) PadRight[{},120,{1,5,4,-1,-5,-4}] (* Harvey P. Dale, Jul 12 2020 *)
-
PARI
a(n)=[1,5,4,-1,-5,-4][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
Binomial transform of 1, 4, -5.
From R. J. Mathar, Oct 30 2008: (Start)
G.f.: (1+4x)/(1-x+x^2).
From Wesley Ivan Hurt, Jun 17 2016: (Start)
a(n) = a(n-1) - a(n-2) for n>1.
a(n) = cos(n*Pi/3) + 3*sqrt(3)*sin(n*Pi/3). (End)
Extensions
Edited by N. J. A. Sloane, Sep 15 2007
Comments