OFFSET
1,2
LINKS
Salvatore Gambino, Terne pitagoriche primitive
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
FORMULA
a(n) = 3+(-1)^n+2*(-1)^((2*n+1-(-1)^n)/4).
G.f.: 2*x^2*(1+2*x+3*x^2)/((1-x)*(1+x)*(1+x^2)). a(n) = 2*A010873(n-1). - R. J. Mathar, Jan 15 2008
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = a(n-4) for n>4.
a(n) = 3 + cos(n*Pi) + 2*cos(n*Pi/2) - 2*sin(n*Pi/2) + I*sin(n*Pi). (End)
MAPLE
seq(op([0, 2, 4, 6]), n=1..40); # Wesley Ivan Hurt, Jul 09 2016
MATHEMATICA
PadRight[{}, 100, {0, 2, 4, 6}] (* Wesley Ivan Hurt, Jul 09 2016 *)
PROG
(Magma) &cat [[0, 2, 4, 6]^^30]; // Wesley Ivan Hurt, Jul 09 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Salvatore Gambino (salvatore.gambino(AT)fastwebnet.it), Oct 04 2007
EXTENSIONS
More terms from R. J. Mathar, Jan 15 2008
STATUS
approved