[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = sum of absolute-valued coefficients of (1+2*x-x^2)^n.
8

%I #14 Jun 04 2023 03:55:55

%S 1,4,12,36,100,300,776,2412,6304,19036,50952,148896,393452,1211444,

%T 3167004,9672772,25295248,76084796,200590424,608621376,1617201648,

%U 4908511140,12658776540,38907904188,102775961200,310485090044

%N a(n) = sum of absolute-valued coefficients of (1+2*x-x^2)^n.

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

%F a(n) = Sum_{k=0..2*n} abs(f(n, k)), where f(n, k) = (sqrt(2) - 1)^k * Sum_{j=0..k} binomial(n, j)*binomial(n, k-j)*(-1)^j*(1+sqrt(2))^(2*j). - _G. C. Greubel_, Jun 03 2023

%t T[n_, k_]:=T[n,k]=SeriesCoefficient[Series[(1+2*x-x^2)^n,{x,0,2n}], k];

%t a[n_]:= a[n]= Sum[Abs[T[n,k]], {k,0,2n}];

%t Table[a[n], {n,0,40}] (* _G. C. Greubel_, Jun 03 2023 *)

%o (PARI) for(n=0,40,S=sum(k=0,2*n,abs(polcoeff((1+2*x-x^2)^n,k,x))); print1(S","))

%o (Magma)

%o m:=40;

%o R<x>:=PowerSeriesRing(Integers(), 2*(m+2));

%o f:= func< n,k | Coefficient(R!( (1+2*x-x^2)^n ), k) >;

%o [(&+[ Abs(f(n,k)): k in [0..2*n]]): n in [0..m]]; // _G. C. Greubel_, Jun 03 2023

%o (SageMath)

%o def f(n,k):

%o P.<x> = PowerSeriesRing(QQ)

%o return P( (1+2*x-x^2)^n ).list()[k]

%o def a(n): return sum( abs(f(n,k)) for k in range(2*n+1) )

%o [a(n) for n in range(41)] # _G. C. Greubel_, Jun 03 2023

%Y Cf. A084775, A084777, A084778, A084779, A084780.

%K nonn

%O 0,2

%A _Paul D. Hanna_, Jun 14 2003