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-6 of 6 results.

A064189 Triangle T(n,k), 0 <= k <= n, read by rows, defined by: T(0,0)=1, T(n,k)=0 if n < k, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-1,k+1).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 4, 5, 3, 1, 9, 12, 9, 4, 1, 21, 30, 25, 14, 5, 1, 51, 76, 69, 44, 20, 6, 1, 127, 196, 189, 133, 70, 27, 7, 1, 323, 512, 518, 392, 230, 104, 35, 8, 1, 835, 1353, 1422, 1140, 726, 369, 147, 44, 9, 1, 2188, 3610, 3915, 3288, 2235, 1242, 560, 200, 54, 10, 1
Offset: 0

Views

Author

N. J. A. Sloane, Sep 21 2001

Keywords

Comments

Motzkin triangle read in reverse order.
T(n,k) = number of lattice paths from (0,0) to (n,k), staying weakly above the x-axis and consisting of steps U=(1,1), D=(1,-1) and H=(1,0). Example: T(3,1) = 5 because we have HHU, UDU, HUH, UHH and UUD. Columns 0,1,2 and 3 give A001006 (Motzkin numbers), A002026 (first differences of Motzkin numbers), A005322 and A005323, respectively. - Emeric Deutsch, Feb 29 2004
Riordan array ((1-x-sqrt(1-2x-3x^2))/(2x^2), (1-x-sqrt(1-2x-3x^2))/(2x)). Inverse is the array (1/(1+x+x^2), x/(1+x+x^2)) (A104562). - Paul Barry, Mar 15 2005
Inverse binomial matrix applied to A039598. - Philippe Deléham, Feb 28 2007
Triangle T(n,k), 0 <= k <= n, read by rows given by: T(0,0)=1, T(n,k)=0 if k < 0 or if k > n, T(n,0) = T(n-1,0) + T(n-1,1), T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-1,k+1) for k >= 1. - Philippe Deléham, Mar 27 2007
This triangle belongs to the family of triangles defined by: T(0,0)=1, T(n,k)=0 if k < 0 or if k > n, T(n,0) = x*T(n-1,0) + T(n-1,1), T(n,k) = T(n-1,k-1) + y*T(n-1,k) + T(n-1,k+1) for k >= 1. Other triangles arise from choosing different values for (x,y): (0,0) -> A053121; (0,1) -> A089942; (0,2) -> A126093; (0,3) -> A126970; (1,0)-> A061554; (1,1) -> A064189; (1,2) -> A039599; (1,3) -> A110877; (1,4) -> A124576; (2,0) -> A126075; (2,1) -> A038622; (2,2) -> A039598; (2,3) -> A124733; (2,4) -> A124575; (3,0) -> A126953; (3,1) -> A126954; (3,2) -> A111418; (3,3) -> A091965; (3,4) -> A124574; (4,3) -> A126791; (4,4) -> A052179; (4,5) -> A126331; (5,5) -> A125906. - Philippe Deléham, Sep 25 2007
Equals binomial transform of triangle A053121. - Gary W. Adamson, Oct 25 2008
Consider a semi-infinite chessboard with squares labeled (n,k), ranks or rows n >= 0, files or columns k >= 0; the number of king-paths of length n from (0,0) to (n,k), 0 <= k <= n, is T(n,k). The recurrence relation given above relates to the movements of the king. This is essentially the comment made by Harrie Grondijs for the Motzkin triangle A026300. - Johannes W. Meijer, Oct 10 2010

Examples

			Triangle begins:
  [0]   1;
  [1]   1,    1;
  [2]   2,    2,    1;
  [3]   4,    5,    3,    1;
  [4]   9,   12,    9,    4,   1;
  [5]  21,   30,   25,   14,   5,   1;
  [6]  51,   76,   69,   44,  20,   6,   1;
  [7] 127,  196,  189,  133,  70,  27,   7,  1;
  [8] 323,  512,  518,  392, 230, 104,  35,  8, 1;
  [9] 835, 1353, 1422, 1140, 726, 369, 147, 44, 9, 1;
  ...
From _Philippe Deléham_, Nov 04 2011: (Start)
Production matrix begins:
  1, 1
  1, 1, 1
  0, 1, 1, 1
  0, 0, 1, 1, 1
  0, 0, 0, 1, 1, 1
  0, 0, 0, 0, 1, 1, 1 (End)
		

References

  • See A026300 for additional references and other information.

Crossrefs

A026300 (the main entry for this sequence) with rows reversed.
Row sums give: A005773(n+1) or A307789(n+2).

Programs

  • Maple
    alias(C=binomial): A064189 := (n,k) -> add(C(n,j)*(C(n-j,j+k)-C(n-j,j+k+2)), j=0..n): seq(seq(A064189(n,k), k=0..n),n=0..10); # Peter Luschny, Dec 31 2019
    # Uses function PMatrix from A357368. Adds a row above and a column to the left.
    PMatrix(10, n -> simplify(hypergeom([1 -n/2, -n/2+1/2], [2], 4))); # Peter Luschny, Oct 08 2022
  • Mathematica
    T[0, 0, x_, y_] := 1; T[n_, 0, x_, y_] := x*T[n - 1, 0, x, y] + T[n - 1, 1, x, y]; T[n_, k_, x_, y_] := T[n, k, x, y] = If[k < 0 || k > n, 0, T[n - 1, k - 1, x, y] + y*T[n - 1, k, x, y] + T[n - 1, k + 1, x, y]]; Table[T[n, k, 1, 1], {n, 0, 10}, {k, 0, n}] // Flatten (* G. C. Greubel, Apr 21 2017 *)
    T[n_, k_] := Binomial[n, k] Hypergeometric2F1[(k - n)/2, (k - n + 1)/2, k + 2, 4];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten  (* Peter Luschny, May 19 2021 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, polcoeff( polcoeff( 2 / (1 - x + sqrt(1 - 2*x - 3*x^2) - 2*x*y) + x * O(x^n), n), k))}; /* Michael Somos, Jun 06 2016 */
  • Sage
    def A064189_triangel(dim):
        M = matrix(ZZ,dim,dim)
        for n in range(dim): M[n,n] = 1
        for n in (1..dim-1):
            for k in (0..n-1):
                M[n,k] = M[n-1,k-1]+M[n-1,k]+M[n-1,k+1]
        return M
    A064189_triangel(9) # Peter Luschny, Sep 20 2012
    

Formula

Sum_{k=0..n} T(n, k)*(k+1) = 3^n.
Sum_{k=0..n} T(n, k)*T(n, n-k) = T(2*n, n) - T(2*n, n+2)
G.f.: M/(1-t*z*M), where M = 1 + z*M + z^2*M^2 is the g.f. of the Motzkin numbers (A001006). - Emeric Deutsch, Feb 29 2004
Sum_{k>=0} T(m, k)*T(n, k) = A001006(m+n). - Philippe Deléham, Mar 05 2004
Sum_{k>=0} T(n-k, k) = A005043(n+2). - Philippe Deléham, May 31 2005
Column k has e.g.f. exp(x)*(BesselI(k,2*x)-BesselI(k+2,2*x)). - Paul Barry, Feb 16 2006
T(n,k) = Sum_{j=0..n} C(n,j)*(C(n-j,j+k) - C(n-j,j+k+2)). - Paul Barry, Feb 16 2006
n-th row is generated from M^n * V, where M = the infinite tridiagonal matrix with all 1's in the super, main and subdiagonals; and V = the infinite vector [1,0,0,0,...]. E.g., Row 3 = (4, 5, 3, 1), since M^3 * V = [4, 5, 3, 1, 0, 0, 0, ...]. - Gary W. Adamson, Nov 04 2006
T(n,k) = A122896(n+1,k+1). - Philippe Deléham, Apr 21 2007
T(n,k) = (k/n)*Sum_{j=0..n} binomial(n,j)*binomial(j,2*j-n-k). - Vladimir Kruchinin, Feb 12 2011
Sum_{k=0..n} T(n,k)*(-1)^k*(k+1) = (-1)^n. - Werner Schulte, Jul 08 2015
Sum_{k=0..n} T(n,k)*(k+1)^3 = (2*n+1)*3^n. - Werner Schulte, Jul 08 2015
G.f.: 2 / (1 - x + sqrt(1 - 2*x - 3*x^2) - 2*x*y) = Sum_{n >= k >= 0} T(n, k) * x^n * y^k. - Michael Somos, Jun 06 2016
T(n,k) = binomial(n, k)*hypergeom([(k-n)/2, (k-n+1)/2], [k+2], 4). - Peter Luschny, May 19 2021
The coefficients of the n-th degree Taylor polynomial of the function (1 - x^2)*(1 + x + x^2)^n expanded about the point x = 0 give the entries in row n in reverse order. - Peter Bala, Sep 06 2022

Extensions

More terms from Vladeta Jovovic, Sep 23 2001

A005774 Number of directed animals of size n (k=1 column of A038622); number of (s(0), s(1), ..., s(n)) such that s(i) is a nonnegative integer and |s(i) - s(i-1)| <= 1 for i = 1,2,...,n, where s(0) = 2; also sum of row n+1 of array T in A026323.

Original entry on oeis.org

0, 1, 3, 9, 26, 75, 216, 623, 1800, 5211, 15115, 43923, 127854, 372749, 1088283, 3181545, 9312312, 27287091, 80038449, 234988827, 690513030, 2030695569, 5976418602, 17601021837, 51869858544, 152951628725, 451271872701, 1332147482253
Offset: 0

Views

Author

Keywords

Comments

Number of ordered trees with n+1 edges, having root degree at least 2 and nonroot outdegrees at most 2. - Emeric Deutsch, Aug 02 2002
From Petkovsek's algorithm, this recurrence does not have any closed form solutions. So there is no hypergeometric closed form for a(n). - Herbert S. Wilf
Sum of two consecutive trinomial coefficients starting two positions before central one. Example: a(4) = 10+16 and (1 + x + x^2)^4 = ... + 10*x^2 + 16*x^3 + 19*x^4 + ... - David Callan, Feb 07 2004
Image of n (A001477) under the Motzkin related matrix A107131. Binomial transform of A037952. - Paul Barry, May 12 2005
a(n) = total number of ascents (maximal runs of consecutive upsteps) in all Motzkin (n+1)-paths. For example, the 9 Motzkin 4-paths are FFFF, FFUD, FUDF, FUFD, UDFF, UDUD, UFDF, UFFD, UUDD and they contain a total of 9 ascents and so a(3)=9 (U=upstep, D=downstep, F=flatstep). - David Callan, Aug 16 2006
Image of the sequence (0,1,2,3,3,3,...) under the array A122896. - Paul Barry, Sep 18 2006
This is some kind of Motzkin transform of A079978 because the substitution x-> x*A001006(x) in the independent variable of the g.f. A079978(x) yields 1,0 followed by this sequence here. - R. J. Mathar, Nov 08 2008

Examples

			G.f.: x + 3*x^2 + 9*x^3 + 26*x^4 + 75*x^5 + 216*x^6 + 623*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a005774 0 = 0
    a005774 n = a038622 n 1 -- Reinhard Zumkeller, Feb 26 2013
  • Maple
    seq( add(binomial(i,k+1)*binomial(i-k,k), k=0..floor(i/2)), i=0..30 ); # Detlef Pauly (dettodet(AT)yahoo.de), Nov 09 2001
    seq(simplify(GegenbauerC(n-2,-n,-1/2) + GegenbauerC(n-1,-n,-1/2)), n=0..27); # Peter Luschny, May 12 2016
  • Mathematica
    CoefficientList[Series[(1-x-Sqrt[1-2x-3x^2])/(x(1-3x+Sqrt[1-2x-3x^2])),{x,0,30}],x] (* Harvey P. Dale, Sep 20 2011 *)
    RecurrenceTable[{a[0]==0, a[1]==1,a[n]==(2n(n+1)a[n-1]+3n(n-1)a[n-2])/ ((n+2)(n-1))},a,{n,30}] (* Harvey P. Dale, Nov 09 2012 *)
  • PARI
    s=[0,1]; {A005774(n)=k=(2*(n+2)*(n+1)*s[2]+3*(n+1)*n*s[1])/((n+3)*n); s[1]=s[2]; s[2]=k; k}
    
  • PARI
    {a(n) = if( n<2, n>0, (2 * (n+1) * n *a(n-1) + 3 * (n-1) * n * a(n-2)) / (n+2) / (n-1))}; /* Michael Somos, May 01 2003 */
    

Formula

Inverse binomial transform of [ 0, 1, 5, 21, 84, ... ] (A002054). - John W. Layman
D-finite with recurrence (n+2)*(n-1)*a(n) = 2*n*(n+1)*a(n-1) + 3*n*(n-1)*a(n-2) for all n in Z. - Michael Somos, May 01 2003
E.g.f.: exp(x)*(BesselI(1, 2*x)+BesselI(2, 2*x)). - Vladeta Jovovic, Jan 01 2004
G.f.: (1-x-sqrt(1-2x-3x^2))/(x(1-3x+sqrt(1-2x-3x^2))); a(n)= Sum_{k=0..n} C(k+1, n-k+1)*C(n, k)*k/(k+1); a(n) = Sum_{k=0..n} C(n, k)*C(k, floor((k-1)/2)). - Paul Barry, May 12 2005
Starting (1, 3, 9, 26, ...) = binomial transform of A026010: (1, 2, 4, 7, 14, 25, 50, 91, ...). - Gary W. Adamson, Oct 22 2007
a(n)*(2+n) = (4+4*n)*a(n-1) - n*a(n-2) + (12-6*n)*a(n-3). - Simon Plouffe, Feb 09 2012
a(n) ~ 3^(n+1/2) / sqrt(Pi*n). - Vaclav Kotesovec, Mar 10 2014
0 = a(n)*(+36*a(n+1) + 18*a(n+2) - 96*a(n+3) + 30*a(n+4)) + a(n+1)*(-6*a(n+1) + 49*a(n+2) - 26*a(n+3) + 3*a(n+4)) + a(n+2)*(+15*a(n+3) - 8*a(n+4)) + a(n+3)*(a(n+4)) if n >= 0. - Michael Somos, Aug 06 2014
a(n) = GegenbauerC(n-2,-n,-1/2) + GegenbauerC(n-1,-n,-1/2). - Peter Luschny, May 12 2016

Extensions

Further descriptions from Clark Kimberling

A349812 Triangle read by rows: row 1 is [1]; for n >= 1, row n gives coefficients of expansion of (-1/x + x)*(1/x + 1 + x)^(n-1) in order of increasing powers of x.

Original entry on oeis.org

1, -1, 0, 1, -1, -1, 0, 1, 1, -1, -2, -2, 0, 2, 2, 1, -1, -3, -5, -4, 0, 4, 5, 3, 1, -1, -4, -9, -12, -9, 0, 9, 12, 9, 4, 1, -1, -5, -14, -25, -30, -21, 0, 21, 30, 25, 14, 5, 1, -1, -6, -20, -44, -69, -76, -51, 0, 51, 76, 69, 44, 20, 6, 1, -1, -7, -27, -70, -133, -189, -196, -127, 0, 127, 196, 189, 133, 70, 27, 7, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 23 2021

Keywords

Comments

The rule for constructing this triangle (ignoring row 0) is the same as that for A027907: each number is the sum of the three numbers immediately above it in the previous row. Here row 1 is [-1, 0, 1] instead of [1, 1, 1].

Examples

			Triangle begins:
   1;
  -1,  0,   1;
  -1, -1,   0,   1,    1;
  -1, -2,  -2,   0,    2,    2,    1;
  -1, -3,  -5,  -4,    0,    4,    5,    3,  1;
  -1, -4,  -9, -12,   -9,    0,    9,   12,  9,   4,   1;
  -1, -5, -14, -25,  -30,  -21,    0,   21, 30,  25,  14,   5,   1;
  -1, -6, -20, -44,  -69,  -76,  -51,    0, 51,  76,  69,  44,  20,  6,  1;
  -1, -7, -27, -70, -133, -189, -196, -127,  0, 127, 196, 189, 133, 70, 27, 7, 1;
  ...
		

Crossrefs

The left half of the triangle is A026300, the right half is A064189 (or A122896). The central (nonzero) column gives the Motzkin numbers A001006.

Programs

  • Maple
    t1:=-1/x+x; m:=1/x+1+x;
    lprint([1]);
    for n from 1 to 12 do
    w1:=expand(t1*m^(n-1));
    w3:=expand(x^n*w1);
    w4:=series(w3,x,2*n+1);
    w5:=seriestolist(w4);
    lprint(w5);
    od:

A383527 Partial sums of A005773.

Original entry on oeis.org

1, 2, 4, 9, 22, 57, 153, 420, 1170, 3293, 9339, 26642, 76363, 219728, 634312, 1836229, 5328346, 15494125, 45137995, 131712826, 384900937, 1126265986, 3299509114, 9676690939, 28407473191, 83470059532, 245465090758, 722406781935, 2127562036990, 6270020029353
Offset: 0

Views

Author

Mélika Tebni, Apr 29 2025

Keywords

Comments

For p prime of the form 4*k+3 (A002145), a(p) == 0 (mod p).
For p Pythagorean prime (A002144), a(p) - 2 == 0 (mod p).
a(n) (mod 2) = A010059(n).
a(A000069(n+1)) is even.
a(A001969(n+1)) is odd.

Crossrefs

Programs

  • Maple
    gf := (1 + sqrt((1 + x) / (1 - 3*x))) / (2*(1 - x)):
    a := n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n = 0 .. 29);
    # Recurrence:
    a:= proc(n) option remember; `if`(n<=2, 2^n, 3*a(n-1) - (6/n-1)*a(n-2) + (6/n-3)*a(n-3)) end:
    seq(a(n), n = 0 .. 29);
  • Mathematica
    Module[{a, n}, RecurrenceTable[{a[n] == 3*a[n-1] - (6-n)*a[n-2]/n + 3*(2-n)*a[n-3]/n, a[0] == 1, a[1] == 2, a[2] == 4}, a, {n, 0, 30}]] (* Paolo Xausa, May 05 2025 *)
  • Python
    from math import comb as C
    def a(n):
      return sum(C(n, k)*abs(sum((-1)**j*C(k, j) for j in range(k//2 + 1))) for k in range(n + 1))
    print([a(n) for n in range(30)])

Formula

First differences of A211278.
a(n) = Sum_{k=0..n} A167630(n, k).
Binomial transform of A210736 (see Python program).
G.f.: (1 + sqrt((1 + x) / (1 - 3*x))) / (2*(1 - x)).
E.g.f.: (Integral_{x=-oo..oo} BesselI(0,2*x) dx + (1 + BesselI(0,2*x)) / 2)*exp(x).
Recurrence: n*a(n) = 3*n*a(n-1) - (6-n)*a(n-2) + 3*(2-n)*a(n-3). If n <= 2, a(n) = 2^n.
a(n) ~ 3^(n + 1/2) / (2*sqrt(Pi*n)). - Vaclav Kotesovec, May 02 2025
From Mélika Tebni, May 09 2025: (Start)
a(n) = A257520(n) + A097893(n-1) for n > 0.
a(n) = Sum_{j=0..n}(Sum_{k=0..j} A122896(j, k)).
a(n+2) - 3*a(n+1) + 2*a(n) = A005774(n).
a(n+2) - 4*a(n+1) + 4*a(n) - a(n-1) = A005775(n) for n >= 3. (End)

A122897 Riordan array (1/(1-x), c(x)-1) where c(x) is the g.f. of A000108.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 8, 5, 1, 1, 22, 19, 7, 1, 1, 64, 67, 34, 9, 1, 1, 196, 232, 144, 53, 11, 1, 1, 625, 804, 573, 261, 76, 13, 1, 1, 2055, 2806, 2211, 1171, 426, 103, 15, 1, 1, 6917, 9878, 8399
Offset: 0

Views

Author

Paul Barry, Sep 18 2006

Keywords

Comments

Product of A007318 and A122896. Inverse of Riordan array ((1+x+x^2)/(1+x)^2,x/(1+x)^2). Row sums are A024718.
The n-th row polynomial (in descending powers of x) equals the n-th Taylor polynomial of the rational function (1 - x^2)/(1 + x + x^2) * (1 + x)^(2*n) about 0. For example, for n = 4 we have (1 - x^2)/( 1 + x + x^2) * (1 + x)^8 = (x^4 + 22*x^3 + 19*x^2 + 7*x + 1) + O(x^5). - Peter Bala, Feb 21 2018

Examples

			Triangle begins
  1,
  1,     1,
  1,     3,     1,
  1,     8,     5,     1,
  1,    22,    19,     7,     1,
  1,    64,    67,    34,     9,    1,
  1,   196,   232,   144,    53,   11,    1,
  1,   625,   804,   573,   261,   76,   13,   1,
  1,  2055,  2806,  2211,  1171,  426,  103,  15,   1,
  1,  6917,  9878,  8399,  4979, 2126,  647, 134,  17,  1,
  1, 23713, 35072, 31655, 20483, 9878, 3554, 932, 169, 19, 1
		

Programs

  • Maple
    A122897 := proc (n, k)
      binomial(2*n, n-k) + 2*add(cos((2/3)*Pi*j)*binomial(2*n, n-k-j), j = 1..n-k)
    end proc:
    for n from 0 to 10 do
    seq(A122897(n, k), k = 0..n)
    end do; # Peter Bala, Feb 21 2018

Formula

T(n,k) = binomial(2*n,n-k) + 2*Sum_{j = 1..n-k} cos((2/3)*Pi*j)* binomial(2*n, n-k-j). - Peter Bala, Feb 21 2018
T(n,k) = k*Sum_{i=0..n-k} C(2*(i+k),i)/(i+k), T(n,0)=1. - Vladimir Kruchinin, Jun 13 2020

A344566 T(n, k) = (-1)^(n - k)*binomial(n - 1, k - 1)*hypergeom([-(n - k)/2, -(n - k - 1)/2], [1 - n], 4). Triangle read by rows, T(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, -1, 1, 0, 0, -2, 1, 0, 1, 1, -3, 1, 0, -1, 2, 3, -4, 1, 0, 0, -4, 2, 6, -5, 1, 0, 1, 2, -9, 0, 10, -6, 1, 0, -1, 3, 9, -15, -5, 15, -7, 1, 0, 0, -6, 3, 24, -20, -14, 21, -8, 1, 0, 1, 3, -18, -6, 49, -21, -28, 28, -9, 1
Offset: 0

Views

Author

Peter Luschny, May 23 2021

Keywords

Comments

The inverse of the Riordan array for directed animals A122896. Without the first column (1, 0, 0, ...) the inverse of the Motzkin triangle A064189.

Examples

			Triangle starts:
[0] 1;
[1] 0,  1;
[2] 0, -1,  1;
[3] 0,  0, -2,  1;
[4] 0,  1,  1, -3,   1;
[5] 0, -1,  2,  3,  -4,   1;
[6] 0,  0, -4,  2,   6,  -5,   1;
[7] 0,  1,  2, -9,   0,  10,  -6, 1;
[8] 0, -1,  3,  9, -15,  -5,  15, -7,  1;
[9] 0,  0, -6,  3,  24, -20, -14, 21, -8, 1.
		

Crossrefs

A117569 (row sums).

Programs

  • Maple
    T := (n,k) -> (-1)^(n-k)*binomial(n-1,k-1)*hypergeom([-(n-k)/2, -(n-k-1)/2], [1-n], 4): seq(seq(simplify(T(n, k)), k=0..n), n = 0..10);
  • SageMath
    # uses[riordan_array from A256893]
    riordan_array(1, x / (1 + x + x^2), 10)

Formula

Riordan_array (1, x / (1 + x + x^2)).
Showing 1-6 of 6 results.