OFFSET
0,4
COMMENTS
Triangular numbers alternating with squares and pentagonal numbers.
LINKS
Ilya Gutkovskiy, Extended illustration of initial terms
Eric Weisstein's World of Mathematics, Triangular Number
Eric Weisstein's World of Mathematics, Square Number
Eric Weisstein's World of Mathematics, Pentagonal Number
Index entries for linear recurrences with constant coefficients, signature (0,0,3,0,0,-3,0,0,1)
FORMULA
G.f.: (1 + x + x^2 + x^4 + 2*x^5)/(1 - x^3)^3.
a(n) = 3*a(n-3) - 3*a(n-6) + a(n-9).
Sum_{n>=0} 1/a(n) = 2 - Pi/sqrt(3) + Pi^2/6 + 3*log(3) = 5.1269715686...
a(n) = (floor(n/3) + 1)*((n+1)*floor(n/3) - 3*floor(n/3)^2 + 2)/2. - Bruno Berselli, Apr 08 2016
EXAMPLE
Illustration of initial terms:
==========================================================
n: 0 1 2 3 4 5 6 7 8
----------------------------------------------------------
o
o o
o o o o o o o o
o o o o o o o o o o o o o
o o o o o o o o o o o o o o o o o o
==========================================================
1 1 1 3 4 5 6 9 12
----------------------------------------------------------
MATHEMATICA
LinearRecurrence[{0, 0, 3, 0, 0, -3, 0, 0, 1}, {1, 1, 1, 3, 4, 5, 6, 9, 12}, 70]
Table[(Floor[n/3] + 1) ((n + 1) Floor[n/3] - 3 Floor[n/3]^2 + 2)/2, {n, 0, 70}] (* Bruno Berselli, Apr 08 2016 *)
CoefficientList[Series[(1+x+x^2+x^4+2x^5)/(1-x^3)^3, {x, 0, 70}], x] (* Harvey P. Dale, Dec 31 2023 *)
PROG
(PARI) x='x+O('x^99); Vec((1+x+x^2+x^4+2*x^5)/(1-x^3)^3) \\ Altug Alkan, Apr 07 2016
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Ilya Gutkovskiy, Apr 07 2016
STATUS
approved