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.

A176334 Diagonal sums of number triangle A176331.

Original entry on oeis.org

1, 1, 2, 4, 9, 21, 51, 124, 305, 755, 1879, 4698, 11792, 29694, 74984, 189811, 481498, 1223713, 3115200, 7942134, 20275362, 51823246, 132604193, 339644739, 870745187, 2234208932, 5737129623, 14742751524, 37909928908, 97543380598
Offset: 0

Views

Author

Paul Barry, Apr 15 2010

Keywords

Crossrefs

Programs

  • GAP
    T:= function(n,k)
        return Sum([0..n], j-> (-1)^(n-j)*Binomial(j,k)*Binomial(j,n-k) );
      end;
    List([0..30], n-> Sum([0..Int(n/2)], j-> T(n-j,j) )); # G. C. Greubel, Dec 07 2019
  • Magma
    T:= func< n,k | &+[(-1)^(n-j)*Binomial(j,n-k)*Binomial(j,k): j in [0..n]] >;
    [(&+[T(n-k,k): k in [0..Floor(n/2)]]): n in [0..30]]; // G. C. Greubel, Dec 07 2019
    
  • Maple
    A176334 := proc(n)
        add(add(binomial(j,n-2*k)*binomial(j,k)*(-1)^(n-k-j),j=0..n-k), k=0..floor(n/2)) ;
    end proc: # R. J. Mathar, Feb 10 2015
  • Mathematica
    T[n_, k_]:= T[n, k]= Sum[(-1)^(n-j)*Binomial[j, k]*Binomial[j, n-k], {j,0,n}]; Table[Sum[T[n-k, k], {k,0,Floor[n/2]}], {n,0,30}] (* G. C. Greubel, Dec 07 2019 *)
  • PARI
    T(n,k) = sum(j=0, n, (-1)^(n-j)*binomial(j, n-k)*binomial(j, k));
    vector(30, n, sum(j=0, (n-1)\2, T(n-j-1,j)) ) \\ G. C. Greubel, Dec 07 2019
    
  • Sage
    @CachedFunction
    def T(n, k): return sum( (-1)^(n-j)*binomial(j, n-k)*binomial(j, k) for j in (0..n))
    [sum(T(n-k, k) for k in (0..floor(n/2))) for n in (0..30)] # G. C. Greubel, Dec 07 2019
    

Formula

a(n) = Sum_{k=0..floor(n/2)} Sum_{j=0..n-k} C(j,n-2k)*C(j,k)*(-1)^(n-k-j).
a(n) ~ phi^(2*n+3) / (4*5^(1/4)*sqrt(Pi*n)), where phi = A001622 is the golden ratio. - Vaclav Kotesovec, Aug 08 2024