A084780 a(n) = sum of absolute-valued coefficients of (1+3*x-x^2)^n.
1, 5, 21, 77, 291, 1119, 3523, 15007, 50923, 182669, 701121, 2379129, 8909361, 32490021, 106309861, 423990203, 1456199483, 5089398187, 19942506259, 65753622619, 252337832801, 903751067081, 3026099773993, 11771846189609
Offset: 0
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
Programs
-
Magma
m:=40; R
:=PowerSeriesRing(Integers(), 2*(m+2)); f:= func< n,k | Coefficient(R!( (1+3*x-x^2)^n ), k) >; [(&+[ Abs(f(n,k)): k in [0..2*n]]): n in [0..m]]; // G. C. Greubel, Jun 04 2023 -
Mathematica
Table[Total[Abs[CoefficientList[Expand[(1+3x-x^2)^n],x]]],{n,0,30}] (* Harvey P. Dale, Jan 04 2012 *)
-
PARI
for(n=0,40,S=sum(k=0,2*n,abs(polcoeff((1+3*x-x^2)^n,k,x))); print1(S","))
-
SageMath
def f(n,k): P.
= PowerSeriesRing(QQ) return P( (1+3*x-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
Formula
a(n) = Sum_{k=0..2*n} abs(f(n, k)), where f(n, k) = (n!/(2*n-k)!) * i^(k-n)*(13)^(n/2)*LegendreP(n, n-k, 3/sqrt(13)).. - G. C. Greubel, Jun 04 2023
Comments