A131718 Period 6: repeat [1, 1, 2, 1, 2, 1].
1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
Crossrefs
Cf. A178149 (decimal expansion of (15+sqrt(1365))/30). - Klaus Brockhaus, May 21 2010
Programs
-
Magma
&cat[[1, 1, 2, 1, 2, 1]: k in [1..30]]; // Vincenzo Librandi, Nov 23 2010
-
Maple
A131718:=n->(4+cos(n*Pi)-cos(n*Pi/3)-cos(2*n*Pi/3))/3: seq(A131718(n), n=0..100); # Wesley Ivan Hurt, Jun 17 2016
-
Mathematica
Flatten[Table[{1, 1, 2, 1, 2, 1}, {20}]] (* Wesley Ivan Hurt, Jun 17 2016 *)
-
PARI
a(n)=[1,1,2,1,2,1][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
G.f.: (1+x+2*x^2+x^3+2*x^4+x^5)/((1-x)*(1+x)*(x^2+x+1)*(x^2-x+1)). - R. J. Mathar, Jan 17 2008
From Wesley Ivan Hurt, Jun 17 2016: (Start)
a(n) = a(n-6) for n>5.
a(n) = (4 + cos(n*Pi) - cos(n*Pi/3) - cos(2*n*Pi/3))/3. (End)
Extensions
More terms from Klaus Brockhaus, May 21 2010
Comments