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.

A092566 Main diagonal of triangle A092565, in which the n-th row polynomial equals the numerator of the n-th convergent of the continued fraction [1 + x + x^2; 1 + x + x^2, 1 + x + x^2, ...].

Original entry on oeis.org

1, 1, 3, 7, 22, 63, 191, 573, 1752, 5372, 16597, 51465, 160258, 500551, 1567881, 4922687, 15488481, 48821964, 154147654, 487412324, 1543231353, 4891986889, 15524303265, 49314008259, 156791992914, 498931763064, 1588891019625
Offset: 0

Views

Author

Paul D. Hanna, Feb 28 2004

Keywords

Comments

T(n,k) is the number of lattice paths from (0,0) to (n,k) using steps (1,0), (2,0), (1,1), and (1,2). - Joerg Arndt, Jun 30 2011
Diagonal of rational function 1/(1 - (x + x^2 + x*y + x*y^2)). - Gheorghe Coserea, Aug 06 2018

Crossrefs

Programs

  • Maple
    series(RootOf((27*x^4-14*x^3+9*x^2+14*x-5)*y^3+(4-3*x)*y+1, y), x=0, 30); # Mark van Hoeij, Apr 16 2013
  • Mathematica
    A037027[n_, k_] := Sum[Binomial[k+j, k]*Binomial[j, n-j-k], {j, 0, n-k}]; A037027[n_, 0] = Fibonacci[n+1]; a[n_] := Sum[A037027[n, k]*Binomial[k, n-k], {k, 0, n}]; Table[a(n), {n,0,26}] (* Jean-François Alcover, Jul 18 2011 *)
    a[0, 0] = 1; a[n_, k_] /; n >= 0 && k >= 0 := a[n, k] = a[n, k-1] + a[n, k-2] + a[n-1, k-1] + a[n-2, k-1]; a[, ] = 0;
    a[n_] := a[n, n];
    a /@ Range[0, 30] (* Jean-François Alcover, Oct 06 2019, after Joerg Arndt *)
  • PARI
    a(n)=if(n<0,0,polcoeff(contfracpnqn(vector(n,i,1+x+x^2))[1,1],n,x))
    
  • PARI
    A037027(n,k)=if(nA037027(n,k)*binomial(k,n-k))
    
  • PARI
    /* computation as lattice paths: */
    N=40; /* that many terms */
    B=matrix(N,N); B[1,1]=1; /* whether T(n,k) memoized */
    M=matrix(N,N); M[1,1]=1; /* memoization for T(n,k) */
    steps=[[1,0], [2,0], [1,1], [1,2]];
    T(n,k)=
    {
    my(ret, dx, dy);
    if ( n<0, return(0) );
    if ( k<0, return(0) );
    if ( B[n+1,k+1], return( M[n+1,k+1]) );
    ret = 0;
    for (s=1, #steps,
    dx = steps[s][1];
    dy = steps[s][2];
    ret += T( n-dx, k-dy );
    );
    B[n+1,k+1] = 1;
    M[n+1,k+1] = ret;
    return( ret );
    }
    T(N-1,N-1); /* trigger computations */
    for (n=1,N, print1(M[n,n],", ")); /* show (diagonal) terms */
    for(n=0,N-1,for(k=0,n,print1(T(n,k),", "););print();); /* show triangle */
    /* Joerg Arndt, Jun 30 2011 */

Formula

a(n) = sum(k=0..n, A037027(n, k)*C(k, n-k) ).
O.g.f. A(x) satisfies the equation (27*x^4 - 14*x^3 + 9*x^2 + 14*x - 5)*A(x)^3 + (4-3*x)*A(x) + 1 = 0. - Mark van Hoeij, Apr 16 2013