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.

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

Original entry on oeis.org

1, 5, 17, 73, 273, 881, 3785, 13081, 48737, 184321, 632193, 2526305, 8854081, 32077921, 124093025, 428178641, 1638563969, 5878561921, 21469361537, 82252171393, 286863949025, 1061000856417, 3998983314849, 14361380710817
Offset: 0

Views

Author

Paul D. Hanna, Jun 14 2003

Keywords

Crossrefs

Programs

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