A254749 1-gonal pyramidal numbers.
1, 2, 2, 0, -5, -14, -28, -48, -75, -110, -154, -208, -273, -350, -440, -544, -663, -798, -950, -1120, -1309, -1518, -1748, -2000, -2275, -2574, -2898, -3248, -3625, -4030, -4464, -4928, -5423, -5950, -6510, -7104, -7733, -8398, -9100, -9840, -10619, -11438
Offset: 1
Examples
G.f. = x + 2*x^2 + 2*x^3 - 5*x^5 - 14*x^6 - 28*x^7 - 48*x^8 - 75*x^9 + ...
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Wikipedia, Pyramidal number.
- Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
Programs
-
Magma
[(n*(4+3*n-n^2))/6: n in [1..60]]; // G. C. Greubel, Aug 03 2018
-
Mathematica
Table[(n*(4+3*n-n^2))/6, {n,1,60}] (* or *) LinearRecurrence[{4,-6,4,-1}, {1, 2, 2, 0}, 60] (* G. C. Greubel, Aug 03 2018 *)
-
PARI
ppg(r, n) = (3*n^2+n^3*(r-2)-n*(r-5))/6 vector(100, n, ppg(1, n))
Formula
a(n) = n*(4 + 3*n - n^2)/6.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
G.f.: x*(1 - 2*x)/(x-1)^4.
E.g.f.: -exp(x)*x*(x^2 - 6)/6. - Elmo R. Oliveira, Aug 04 2025
Comments