A270695 Alternating sum of centered octagonal pyramidal numbers.
0, -1, 9, -26, 58, -107, 179, -276, 404, -565, 765, -1006, 1294, -1631, 2023, -2472, 2984, -3561, 4209, -4930, 5730, -6611, 7579, -8636, 9788, -11037, 12389, -13846, 15414, -17095, 18895, -20816, 22864, -25041, 27353, -29802, 32394, -35131, 38019
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- OEIS Wiki, Centered pyramidal numbers
- Index entries for linear recurrences with constant coefficients, signature (-3,-2,2,3,1).
Crossrefs
Programs
-
Magma
[((-1)^n*(4*n^2 - 1)*(2*n + 3) + 3)/12 : n in [0..40]]; // Wesley Ivan Hurt, Mar 21 2016
-
Maple
A270695:= n-> ((-1)^n*(4*n^2 -1)*(2*n+3) +3)/12: seq(A270695(n), n=0..40); # G. C. Greubel, Apr 02 2021
-
Mathematica
LinearRecurrence[{-3, -2, 2, 3, 1}, {0, -1, 9, -26, 58}, 39] Table[((-1)^n (4 n^2 - 1) (2 n + 3) + 3)/12, {n, 0, 38}]
-
PARI
x='x+O('x^100); concat(0, Vec(-x*(1-6*x+x^2)/((1-x)*(1+x)^4))) \\ Altug Alkan, Mar 21 2016
-
Sage
[((-1)^n*(4*n^2 -1)*(2*n+3) +3)/12 for n in (0..40)] # G. C. Greubel, Apr 02 2021
Formula
G.f.: -x*(1 - 6*x + x^2)/((1 - x)*(1 + x)^4).
E.g.f.: (1/12)*(3*exp(x) - (3 + 18*x - 36*x^2 + 8*x^3)*exp(-x)).
a(n) = -3*a(n-1) - 2*a(n-2) + 2*a(n-3) + 3*a(n-4) + a(n-5).
a(n) = ((-1)^n*(4*n^2 - 1)*(2*n + 3) + 3)/12.
Extensions
a(6)=179 inserted by Georg Fischer, Apr 03 2019