OFFSET
1,5
COMMENTS
LINKS
G. C. Greubel and Vincenzo Librandi, Table of n, a(n) for n = 1..10000 [Originally computed by Remi Eismann]
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = (n+1)*(n-2)/2 = A000096(n-2) for n >= 5 and a(n) = 0 for n <= 4. - M. F. Hasler, Jan 10 2011
From Chai Wah Wu, Jun 21 2016: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 7.
G.f.: x^5*(5*x^2 - 13*x + 9)/(1 - x)^3. (End)
EXAMPLE
MATHEMATICA
Join[{0, 0, 0, 0}, LinearRecurrence[{3, -3, 1}, {9, 14, 20}, 100]] (* G. C. Greubel, Jun 22 2016 *)
lim = 10^4; Table[SelectFirst[Reverse@ Range@ lim, Function[k, PolygonalNumber[n + 1] == # + Mod[#, k] &@ PolygonalNumber@ n]], {n, 53}] /. {k_ /; MissingQ@ k -> 0, k_ /; k == lim -> 0} (* Michael De Vlieger, Jun 30 2016, Version 10.4 *)
PROG
(Magma) [0, 0, 0, 0] cat [(n+1)*(n-2)/2: n in [5..60]]; // Vincenzo Librandi, Jun 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rémi Eismann, Jan 10 2011
STATUS
approved