A158068 Period 6: repeat [1, 2, 2, 1, 5, 5].
1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2, 1, 5, 5, 1, 2, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1).
Programs
-
Magma
&cat[[1, 2, 2, 1, 5, 5]: n in [0..20]]; // Wesley Ivan Hurt, Jun 17 2016
-
Maple
A158068:=n->(8-5*cos(2*n*Pi/3)-3*sqrt(3)*sin(n*Pi/3))/3: seq(A158068(n), n=0..100); # Wesley Ivan Hurt, Jun 17 2016
-
Mathematica
PadRight[{}, 120, {1,2,2,1,5,5}] (* or *) LinearRecurrence[{1,-1,1,-1,1},{1,2,2,1,5}, 120] (* Harvey P. Dale, Jan 27 2015 *)
Formula
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n>4.
G.f.: (1+x+5*x^4+x^2)/((1-x)*(1-x+x^2)*(1+x+x^2)). [Maksym Voznyy (voznyy(AT)mail.ru), Jul 26 2009]
a(n) = (8-5*cos(2*n*Pi/3)-3*sqrt(3)*sin(n*Pi/3))/3. - Wesley Ivan Hurt, Jun 17 2016
Extensions
Offset set to 0 - R. J. Mathar, Sep 17 2009
Comments