OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,3,0,0,-3,0,0,1).
FORMULA
G.f.: -(2*x^7+x^5-4*x^4-x^3+2*x+1) / ((x-1)^3*(x^2+x+1)^3). - Colin Barker, Jul 31 2013
MAPLE
a := proc(n) if n mod 3 = 0 then RETURN(n/3+1) fi: if n mod 3 = 1 then RETURN(2) fi: if n mod 3 = 2 then RETURN(((n-2)/3)*((n-2)/3+1)/2) fi: end: for n from 0 to 150 do printf(`%d, `, a(n)) od:
MATHEMATICA
Flatten[ Table[ {n, 2, n(n - 1)/2}, {n, 1, 27}]]
With[{nn=30}, Riffle[Riffle[Range[nn], Accumulate[Range[0, nn]], {2, -1, 2}], 2, {2, -1, 3}]] (* Harvey P. Dale, May 20 2013 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 18 2003
EXTENSIONS
More terms from James A. Sellers and Robert G. Wilson v, Jun 21 2003
STATUS
approved