OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(0)=0, afterwards if n is odd then a(n)=1 else a(n)=(n+4)/2
a(0)=0, afterwards a(n)=1 for odd n and n/2+2 for even n.
a(n)= +2*a(n-2) -a(n-4), n>4. a(n) = (6+n*((-1)^n+1)+2*(-1)^n)/4, n>0. G.f.: -x*(-1-3*x+x^2+2*x^3) / ( (x-1)^2*(1+x)^2 ). [From R. J. Mathar, Aug 03 2010]
MATHEMATICA
Table[Mod[n(n+1)/2, n+2], {n, 0, 200}]
LinearRecurrence[{0, 2, 0, -1}, {0, 1, 3, 1, 4}, 110] (* or *) Join[{0, 1}, Riffle[Range[3, 50], 1]] (* Harvey P. Dale, Apr 02 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Jul 28 2010
STATUS
approved