OFFSET
0,4
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
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
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 *)
PROG
(Magma) &cat [[1, 1, 1, 3, 3, 3]^^30]; // Wesley Ivan Hurt, Jun 20 2016
(PARI) a(n) = [1, 1, 1, 3, 3, 3][n%6+1]; \\ Jinyuan Wang, Feb 26 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 28 2007
STATUS
approved