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.

A122610 Triangle read by rows: T(n,k) is coefficient of x^k in Sum_{m=0..n} x^m*(1-x)^(n-m)*(-1)^[(m+1)/2]*binomial(m-[(m+1)/2],[m/2]).

Original entry on oeis.org

1, 1, -2, 1, -3, 1, 1, -4, 3, 1, 1, -5, 6, 1, -2, 1, -6, 10, -1, -6, 1, 1, -7, 15, -6, -11, 6, 1, 1, -8, 21, -15, -15, 18, 1, -2, 1, -9, 28, -29, -15, 39, -6, -9, 1, 1, -10, 36, -49, -7, 69, -30, -21, 9, 1, 1, -11, 45, -76, 14, 105, -84, -30, 36, 1, -2, 1, -12, 55, -111, 54, 140, -182, -15, 96, -14, -12, 1, 1, -13, 66, -155
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Examples

			1;
1, -2;
1, -3,  1;
1, -4,  3,   1;
1, -5,  6,   1,  -2;
1, -6, 10,  -1,  -6,  1;
1, -7, 15,  -6, -11,  6, 1;
1, -8, 21, -15, -15, 18, 1, -2;
		

Crossrefs

Cf. A066170.

Programs

  • Mathematica
    T[n_, k_] := (-1)^Floor[(k + 1)/2]*Binomial[n - Floor[(k + 1)/2], Floor[k/2]]; a = Table[CoefficientList[Sum[T[n, k]*p^k*(1 - p)^(n -k), {k, 0, n}], p], {n, 0, 10}]; Flatten[a]
  • PARI
    {T(n,k)=local(A); if(k<0||k>n, 0, A=sum(k=0, n, x^k*(1-x)^(n-k)*(-1)^((k+1)\2)*binomial(n-((k+1)\2),k\2)); polcoeff(A,k))}
    
  • Sage
    @CachedFunction
    def T(n,k):
        if n< 0: return 0
        if n==0: return 1 if k == 0 else 0
        h = 2*T(n-1,k) if n==1 else T(n-1,k)
        return T(n-1,k-1) - T(n-2,k) - h
    A122610 = lambda n,k: T(n,n-k)
    for n in (0..9): [A122610(n,k) for k in (0..n)] # Peter Luschny, Nov 20 2012

Extensions

Edited by N. J. A. Sloane, Sep 24 2006
Offset set to 0 by Michel Marcus, Feb 07 2014