login
Alternating sum of centered octagonal pyramidal numbers.
1

%I #25 Sep 08 2022 08:46:16

%S 0,-1,9,-26,58,-107,179,-276,404,-565,765,-1006,1294,-1631,2023,-2472,

%T 2984,-3561,4209,-4930,5730,-6611,7579,-8636,9788,-11037,12389,-13846,

%U 15414,-17095,18895,-20816,22864,-25041,27353,-29802,32394,-35131,38019

%N Alternating sum of centered octagonal pyramidal numbers.

%H G. C. Greubel, <a href="/A270695/b270695.txt">Table of n, a(n) for n = 0..1000</a>

%H OEIS Wiki, <a href="http://oeis.org/wiki/Centered_pyramidal_numbers">Centered pyramidal numbers</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (-3,-2,2,3,1).

%F G.f.: -x*(1 - 6*x + x^2)/((1 - x)*(1 + x)^4).

%F E.g.f.: (1/12)*(3*exp(x) - (3 + 18*x - 36*x^2 + 8*x^3)*exp(-x)).

%F a(n) = -3*a(n-1) - 2*a(n-2) + 2*a(n-3) + 3*a(n-4) + a(n-5).

%F a(n) = ((-1)^n*(4*n^2 - 1)*(2*n + 3) + 3)/12.

%p 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

%t LinearRecurrence[{-3, -2, 2, 3, 1}, {0, -1, 9, -26, 58}, 39]

%t Table[((-1)^n (4 n^2 - 1) (2 n + 3) + 3)/12, {n, 0, 38}]

%o (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

%o (Magma) [((-1)^n*(4*n^2 - 1)*(2*n + 3) + 3)/12 : n in [0..40]]; // _Wesley Ivan Hurt_, Mar 21 2016

%o (Sage) [((-1)^n*(4*n^2 -1)*(2*n+3) +3)/12 for n in (0..40)] # _G. C. Greubel_, Apr 02 2021

%Y Cf. A000447 (centered octagonal pyramidal numbers).

%Y Cf. A000330, A006324 (partial sums of centered octagonal pyramidal numbers), A019298, A232599.

%K easy,sign

%O 0,3

%A _Ilya Gutkovskiy_, Mar 21 2016

%E a(6)=179 inserted by _Georg Fischer_, Apr 03 2019