cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, 6, 34, 184, 956, 4776, 22986, 118304, 624634, 3281346, 17687330, 92606914, 470392898, 2348031430, 11932314170, 62345998488, 326780375778, 1691296908076, 8780141027670, 45168987187058, 230213109996786
Offset: 0

Views

Author

Paul D. Hanna, Jun 14 2003

Keywords

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 100);
    f:= func< n,k | Coefficient(R!( (1+x-4*x^2)^n ), k) >;
    [(&+[ Abs(f(n,k)): k in [0..2*n]]): n in [0..40]]; // G. C. Greubel, Jun 03 2023
    
  • Mathematica
    T[n_, k_]:=T[n,k]=SeriesCoefficient[Series[(1+x-2*x^2)^n,{x,0,2n}], k];
    a[n_]:= a[n]= Sum[Abs[T[[k+1]]], {k,0,2n}];
    Table[a[n], {n,0,40}] (* G. C. Greubel, Jun 03 2023 *)
  • PARI
    for(n=0,40,S=sum(k=0,2*n,abs(polcoeff((1+1*x-4*x^2)^n,k,x))); print1(S","))
    
  • SageMath
    def f(n,k):
        P. = PowerSeriesRing(QQ)
        return P( (1+x-4*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 03 2023

Formula

a(n) = Sum_{k=0..2*n} abs(f(n, k)), where f(n, k) = ((sqrt(17) -1)/2)^k * Sum_{j=0..k} binomial(n, j)*binomial(n, k-j)*(-1)^j*((1+sqrt(17))/4 )^(2*j). - G. C. Greubel, Jun 03 2023