A135265 Period 6: repeat [1, 1, 1, 2, 2, 2].
1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
Crossrefs
Cf. A178331 (decimal expansion of (17+2*sqrt(210))/29). [Klaus Brockhaus, May 25 2010]
Programs
-
Magma
&cat[[1, 1, 1, 2, 2, 2]^^20]; // Wesley Ivan Hurt, Jun 20 2016
-
Maple
A135265:=n->[1, 1, 1, 2, 2, 2][(n mod 6)+1]: seq(A135265(n), n=0..100); # Wesley Ivan Hurt, Jun 20 2016
-
Mathematica
PadRight[{}, 100, {1, 1, 1, 2, 2, 2}] (* Wesley Ivan Hurt, Jun 20 2016 *)
-
PARI
a(n)=[1,1,1,2,2,2][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
G.f.: (1+2*x^3)/((1-x)*(1+x)*(1-x+x^2)). [Jaume Oliver Lafont, Aug 30 2009]
a(n) = 3/2 - cos(Pi*n/3)/3 - sin(Pi*n/3)/sqrt(3) - (-1)^n/6. - R. J. Mathar, Oct 08 2011
a(n) = 1+(1-(-1)^floor(n/3))/2. [Bruno Berselli, Jul 12 2013]
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3. - Wesley Ivan Hurt, Jun 20 2016
Extensions
More terms from Klaus Brockhaus, May 25 2010