A130974 Period 6: repeat [1, 1, 1, 3, 3, 3].
1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
Crossrefs
Cf. A177957 (decimal expansion of (12+3*sqrt(35))/19). - Klaus Brockhaus, May 16 2010
Programs
-
Magma
&cat [[1, 1, 1, 3, 3, 3]^^30]; // Wesley Ivan Hurt, Jun 20 2016
-
Maple
A130974:=n->[1, 1, 1, 3, 3, 3][(n mod 6)+1]: seq(A130974(n), n=0..100); # Wesley Ivan Hurt, Jun 20 2016
-
Mathematica
PadRight[{}, 100, {1, 1, 1, 3, 3, 3}] (* Wesley Ivan Hurt, Jun 20 2016 *)
-
PARI
a(n) = [1, 1, 1, 3, 3, 3][n%6+1]; \\ Jinyuan Wang, Feb 26 2020
Formula
G.f.: (1+3*x^3)/((1-x)*(1+x)*(1-x+x^2)). - R. J. Mathar, Nov 15 2007
a(n) = 2 - (2/3)*cos((1/3)*Pi*n) - (2/3)*3^(1/2)*sin((1/3)*Pi*n) + (1/3)*(-1)^(1+n). - R. J. Mathar, Nov 15 2007
a(n) = 2 - (-1)^floor(n/3). - Bruno Berselli, Jul 09 2013
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3. - Wesley Ivan Hurt, Jun 20 2016