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.

Showing 1-3 of 3 results.

A025177 Triangular array, read by rows: first differences in n,n direction of trinomial array A027907.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 2, 4, 4, 4, 2, 1, 1, 3, 7, 10, 12, 10, 7, 3, 1, 1, 4, 11, 20, 29, 32, 29, 20, 11, 4, 1, 1, 5, 16, 35, 60, 81, 90, 81, 60, 35, 16, 5, 1, 1, 6, 22, 56, 111, 176, 231, 252, 231, 176, 111, 56, 22, 6, 1, 1, 7, 29, 84, 189, 343, 518, 659, 714, 659, 518, 343
Offset: 0

Views

Author

Keywords

Comments

The Motzkin transforms of the rows starting (1, 2), (1, 3) and (1, 4), extended by zeros after their last element, are apparently in A026134, A026109 and A026110. - R. J. Mathar, Dec 11 2008

Examples

			               1
            1  0  1
         1  1  2  1  1
      1  2  4  4  4  2  1
   1  3  7 10 12 10  7  3  1
1  4 11 20 29 32 29 20 11  4  1
		

Crossrefs

Columns include A025178, A025179, A025180, A025181, A025182.
Cf. A024996, A025192 (row sums).

Programs

  • Maple
    A025177 := proc(n,k)
        option remember;
        if k < 0 or k > 2*n then
            0;
        elif n = 0 then
            1 ;
        elif n = 1 then
            op(k+1,[1,0,1]) ;
        else
            procname(n-1,k-2)+procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc:
    seq(seq(A025177(n,k),k=0..2*n),n=0..20)  ; # R. J. Mathar, Feb 25 2015
  • Mathematica
    nmax = 10; CoefficientList[CoefficientList[Series[(1 - y*x)/(1 - x*(1 + y + y^2)), {x, 0, nmax}, {y, 0, 2*nmax}], x], y] // Flatten (* G. C. Greubel, May 22 2017; amended by Georg Fischer, Jun 24 2020 *)
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, if( n==1, [1,0,1][k+1], if( n==2, [1,1,2,1,1][k+1], T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)))))};
    
  • PARI
    T(n,k)=polcoeff(Ser(polcoeff(Ser((1-y*z)/(1-z*(1+y+y^2)),y),k,y),z),n,z)
    
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( n==0, 1, polcoeff( (1 + x + x^2)^n, k) - polcoeff( (1 + x + x^2)^(n-1), k-1)))};
    
  • PARI
    g=matrix(33,65);
    for(n=0,32,for(k=0,2*n,g[n+1,k+1]=0));
    g[1,1]=1;
    g[2,1]=1;g[2,2]=0;g[2,3]=1;
    g[3,1]=1;g[3,2]=1;g[3,3]=2;g[3,4]=1;g[3,5]=1;
    for(n=0,2,for(k=0,2*n,print(n," ",k," ",g[n+1,k+1])))
    for(n=3,32,g[n+1,1]=1;print(n," 1 1");g[n+1,2]=n-1;print(n," 2 ",n-1);for(k=2,2*n,g[n+1,k+1]=g[n,k-1]+g[n,k]+g[n,k+1];print(n," ",k," ",g[n+1,k+1])))
    \\ Michael B. Porter, Feb 02 2010

Formula

T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), starting with [1], [1, 0, 1].
G.f.: (1-y*z)/[1-z*(1+y+y^2)].

Extensions

Edited by Ralf Stephan, Jan 09 2005
Offset corrected by R. J. Mathar, Feb 25 2015

A026105 Triangle T read by rows: differences of Motzkin triangle (A026300).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 3, 6, 7, 5, 1, 4, 10, 16, 18, 12, 1, 5, 15, 30, 44, 46, 30, 1, 6, 21, 50, 89, 120, 120, 76, 1, 7, 28, 77, 160, 259, 329, 316, 196, 1, 8, 36, 112, 265, 496, 748, 904, 841, 512, 1, 9, 45, 156, 413, 873, 1509, 2148, 2493, 2257, 1353, 1, 10, 55, 210, 614, 1442, 2795, 4530, 6150, 6898, 6103, 3610
Offset: 0

Views

Author

Keywords

Comments

For n >= 2, T(n,k)= number of nonnegative integer strings s(0),...,s(n) such that s(n)=n-k, s(0)=s(1)=1, |s(i)-s(i-1)|<=1 for i >= 2.

Examples

			1
1,1
1,1,1
1,2,3,2
1,3,6,7,5
1,4,10,16,18,12
1,5,15,30,44,46,30
		

Crossrefs

Right-hand columns include A002026, A026107, A026134, A026109, A026110.
Row sums are in A025566. Central column is in A026112.

Formula

T(n, k) = A026300(n, k) - A026300(n-1, k-1), T(1, 1) = 1.
T(i, 0)=1 for i >= 0, T(2, 1)=1, T(2, 2)=1, T(3, 1)=2, T(3, 2)=3, T(3, 3)=2; and for i >= 4, T(i, 1)=i-1, T(i, i)=T(i-1, i-2)+T(i-1, i-1) and T(i, j)=T(i-1, j-2)+T(i-1, j-1)+T(i-1, j) for j=2, 3, ...., i-1.
Right-hand columns have g.f. (1-z)*M^k, where M is g.f. of Motzkin numbers (A001006).

Extensions

Edited by Ralf Stephan, Dec 18 2004
a(65) corrected and more terms from Sean A. Irvine, Sep 16 2019
Offset set to 0 by Alois P. Heinz, Sep 16 2019

A026124 a(n) = number of (s(0),s(1),...,s(n)) such that every s(i) is a nonnegative integer, s(0) = 1, s(n) = 3, |s(1) - s(0)| = 1, |s(i) - s(i-1)| <= 1 for i >= 2. Also a(n) = T(n,n-2), where T is the array in A026120.

Original entry on oeis.org

1, 2, 7, 20, 59, 170, 489, 1400, 4002, 11428, 32626, 93160, 266136, 760800, 2176644, 6232896, 17864841, 51253794, 147188535, 423098404, 1217371023, 3505992050, 10106384621, 29158627592, 84200265555, 243345531806, 703858089717
Offset: 2

Views

Author

Keywords

Crossrefs

First differences of A026109.

Formula

G.f.: z^2(1-z)^2M^4, with M the g.f. of the Motzkin numbers (A001006).
Conjecture: (n+6)*a(n) +(-5*n-19)*a(n-1) +4*n*a(n-2) +8*(n+1)*a(n-3) +(-5*n+22)*a(n-4) +3*(-n+5)*a(n-5)=0. - R. J. Mathar, Jun 23 2013
Showing 1-3 of 3 results.