OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{k=0..2*n} abs(f(n,k)), where f(n, k) = Sum_{j=0..k} binomial(n, j)*binomial(n, k-j)*(-3)^j = binomial(n, k)*Hypergeometric2F1([-n, -k], [n-k+1], -3) = (n!/k!)*4^n*(-3)^((k-n)/2)*LegendreP(n, k-n, -1/2). - G. C. Greubel, Jun 04 2023
MATHEMATICA
T[n_, k_]:=T[n, k]=SeriesCoefficient[Series[(1+2*x-3*x^2)^n, {x, 0, 2n}], k];
a[n_]:= a[n]= Sum[Abs[T[n, k]], {k, 0, 2n}];
Table[a[n], {n, 0, 40}] (* G. C. Greubel, Jun 04 2023 *)
PROG
(PARI) for(n=0, 40, S=sum(k=0, 2*n, abs(polcoeff((1+2*x-3*x^2)^n, k, x))); print1(S", "))
(Magma)
m:=40;
R<x>:=PowerSeriesRing(Integers(), 2*(m+2));
f:= func< n, k | Coefficient(R!( (1+2*x-3*x^2)^n ), k) >;
[(&+[ Abs(f(n, k)): k in [0..2*n]]): n in [0..m]]; // G. C. Greubel, Jun 04 2023
(SageMath)
def f(n, k):
P.<x> = PowerSeriesRing(QQ)
return P( (1+2*x-3*x^2)^n ).list()[k]
def a(n): return sum( abs(f(n, k)) for k in range(2*n+1) )
[a(n) for n in range(41)] # G. C. Greubel, Jun 04 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jun 14 2003
STATUS
approved