OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..3316
Wikipedia, Pentagonal number
Index entries for linear recurrences with constant coefficients, signature (-2).
FORMULA
a(n) = -2*a(n-1) for n > 3.
For n >= 3, a(n) = (-1)^n * 27 * 2^(n-3). - Vaclav Kotesovec, Dec 20 2017
G.f.: (1-x)^3/(1+2*x). - Robert Israel, Dec 20 2017
E.g.f.: (1/8)*(- 19 + 14*x - 2*x^2 + 27*exp(-2*x) ). - Alejandro J. Becerra Jr., Feb 16 2021
MAPLE
1, -5, 13, seq(-27*(-2)^i, i=0..50); # Robert Israel, Dec 20 2017
MATHEMATICA
CoefficientList[Series[1/Sum[(k+1)*(3*k+2)*x^k/2, {k, 0, 30}], {x, 0, 30}], x] (* Vaclav Kotesovec, Dec 20 2017 *)
Join[{1, -5, 13}, Table[(-1)^n * 27 * 2^(n-3), {n, 3, 30}]] (* Vaclav Kotesovec, Dec 20 2017 *)
PROG
(PARI) N=66; my(x='x+O('x^N)); Vec(1/sum(k=0, N, (k+1)*(3*k+2)/2*x^k))
(PARI) first(n) = Vec((1-x)^3/(1+2*x) + O(x^n)) \\ Iain Fox, Dec 20 2017
(Magma) [1, -5, 13] cat [-27*(-2)^(n-3): n in [3..50]]; // G. C. Greubel, Jan 04 2023
(SageMath) [1, -5, 13]+[-27*(-2)^(n-3) for n in range(3, 51)] # G. C. Greubel, Jan 04 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Seiichi Manyama, Dec 20 2017
STATUS
approved