login
A154127
Period 6: repeat [1, 2, 5, 8, 7, 4].
4
1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2, 5, 8, 7, 4, 1, 2
OFFSET
0,2
FORMULA
From R. J. Mathar, Feb 25 2009, Mar 09 2009: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
G.f.: (1+x+3*x^2+4*x^3)/((1-x)*(1+x)*(x^2-x+1)). (End)
a(n) = (27-cos(n*Pi)-20*cos(n*Pi/3)-4*sqrt(3)*sin(n*Pi/3))/6. - Wesley Ivan Hurt, Jun 17 2016
MAPLE
A154127:=n->(27-cos(n*Pi)-20*cos(n*Pi/3)-4*sqrt(3)*sin(n*Pi/3))/6: seq(A154127(n), n=0..100); # Wesley Ivan Hurt, Jun 17 2016
MATHEMATICA
Flatten[Table[{1, 2, 5, 8, 7, 4}, {20}]] (* Wesley Ivan Hurt, Jun 17 2016 *)
PROG
(PARI) a(n)=[1, 2, 5, 8, 7, 4][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
(Magma) &cat[[1, 2, 5, 8, 7, 4]: n in [0..20]]; // Wesley Ivan Hurt, Jun 17 2016
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Paul Curtz, Jan 05 2009
EXTENSIONS
Corrected numerator in g.f R. J. Mathar, Mar 09 2009
STATUS
approved