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.

Previous Showing 21-27 of 27 results.

A359364 Triangle read by rows. The Motzkin triangle, the coefficients of the Motzkin polynomials. M(n, k) = binomial(n, k) * CatalanNumber(k/2) if k is even, otherwise 0.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 1, 0, 3, 0, 1, 0, 6, 0, 2, 1, 0, 10, 0, 10, 0, 1, 0, 15, 0, 30, 0, 5, 1, 0, 21, 0, 70, 0, 35, 0, 1, 0, 28, 0, 140, 0, 140, 0, 14, 1, 0, 36, 0, 252, 0, 420, 0, 126, 0, 1, 0, 45, 0, 420, 0, 1050, 0, 630, 0, 42, 1, 0, 55, 0, 660, 0, 2310, 0, 2310, 0, 462, 0
Offset: 0

Views

Author

Peter Luschny, Jan 09 2023

Keywords

Comments

The generalized Motzkin numbers M(n, k) are a refinement of the Motzkin numbers M(n) (A001006) in the sense that they are coefficients of polynomials M(n, x) = Sum_{n..k} M(n, k) * x^k that take the value M(n) at x = 1. The coefficients of x^n are the aerated Catalan numbers A126120.
Variants are the irregular triangle A055151 with zeros deleted, A097610 with reversed rows, A107131 and A080159.
In the literature the name 'Motzkin triangle' is also used for the triangle A026300, which is generated from the powers of the generating function of the Motzkin numbers.

Examples

			Triangle M(n, k) starts:
[0] 1;
[1] 1, 0;
[2] 1, 0,  1;
[3] 1, 0,  3, 0;
[4] 1, 0,  6, 0,   2;
[5] 1, 0, 10, 0,  10, 0;
[6] 1, 0, 15, 0,  30, 0,   5;
[7] 1, 0, 21, 0,  70, 0,  35, 0;
[8] 1, 0, 28, 0, 140, 0, 140, 0,  14;
[9] 1, 0, 36, 0, 252, 0, 420, 0, 126, 0;
		

Crossrefs

Cf. A001006 (Motzkin numbers), A026300 (Motzkin gf. triangle), A126120 (aerated Catalan), A000108 (Catalan).

Programs

  • Maple
    CatalanNumber := n -> binomial(2*n, n)/(n + 1):
    M := (n, k) -> ifelse(irem(k, 2) = 1, 0, CatalanNumber(k/2)*binomial(n, k)):
    for n from 0 to 9 do seq(M(n, k), k = 0..n) od;
    # Alternative, as coefficients of polynomials:
    p := n -> hypergeom([(1 - n)/2, -n/2], [2], (2*x)^2):
    seq(print(seq(coeff(simplify(p(n)), x, k), k = 0..n)), n = 0..9);
    # Using the exponential generating function:
    egf := exp(x)*BesselI(1, 2*x*t)/(x*t): ser:= series(egf, x, 11):
    seq(print(seq(coeff(simplify(n!*coeff(ser, x, n)), t, k), k = 0..n)), n = 0..9);
  • Python
    from functools import cache
    @cache
    def M(n: int, k: int) -> int:
        if k %  2: return 0
        if n <  3: return 1
        if n == k: return (2 * (n - 1) * M(n - 2, n - 2)) // (n // 2 + 1)
        return (M(n - 1, k) * n) // (n - k)
    for n in range(10): print([M(n, k) for k in range(n + 1)])

Formula

Let p(n, x) = hypergeom([(1 - n)/2, -n/2], [2], (2*x)^2).
p(n, 1) = A001006(n); p(n, sqrt(2)) = A025235(n); p(n, 2) = A091147(n).
p(2, n) = A002522(n); p(3, n) = A056107(n).
p(n, n) = A359649(n); 2^n*p(n, 1/2) = A000108(n+1).
M(n, k) = [x^k] p(n, x).
M(n, k) = [t^k] (n! * [x^n] exp(x) * BesselI(1, 2*t*x) / (t*x)).
M(n, k) = [t^k][x^n] ((1 - x - sqrt((x-1)^2 - (2*t*x)^2)) / (2*(t*x)^2)).
M(n, n) = A126120(n).
M(n, n-1) = A138364(n), the number of Motzkin n-paths with exactly one flat step.
M(2*n, 2*n) = A000108(n), the number of peakless Motzkin paths having a total of n up and level steps.
M(4*n, 2*n) = A359647(n), the central terms without zeros.
M(2*n+2, 2*n) = A002457(n) = (-4)^n * binomial(-3/2, n).
Sum_{k=0..n} M(n - k, k) = A023426(n).
Sum_{k=0..n} k * M(n, k) = 2*A014531(n-1) = 2*GegenbauerC(n - 2, -n, -1/2).
Sum_{k=0..n} i^k*M(n, k) = A343773(n), (i the imaginary unit), is the excess of the number of even Motzkin n-paths (A107587) over the odd ones (A343386).
Sum_{k=0..n} Sum_{j=0..k} M(n, j) = A189912(n).
Sum_{k=0..n} Sum_{j=0..k} M(n, n-j) = modified A025179(n).
For a recursion see the Python program.

A119462 Triangle read by rows: T(n,k) is the number of circular binary words of length n having k occurrences of 01 (0 <= k <= floor(n/2)).

Original entry on oeis.org

1, 2, 2, 2, 2, 6, 2, 12, 2, 2, 20, 10, 2, 30, 30, 2, 2, 42, 70, 14, 2, 56, 140, 56, 2, 2, 72, 252, 168, 18, 2, 90, 420, 420, 90, 2, 2, 110, 660, 924, 330, 22, 2, 132, 990, 1848, 990, 132, 2, 2, 156, 1430, 3432, 2574, 572, 26, 2, 182, 2002, 6006, 6006, 2002, 182, 2, 2, 210, 2730, 10010, 12870, 6006, 910, 30
Offset: 0

Views

Author

Emeric Deutsch, May 21 2006

Keywords

Comments

Row n contains 1 + floor(n/2) terms.
Sum of entries in row n is 2^n (A000079).
2*binomial(n-1,2k) is also the number of permutations avoiding both 123 and 132 with k valleys, i.e., positions with w[i]>w[i+1]Lara Pudwell, Dec 19 2018

Examples

			T(3,1) = 6 because we have 001, 010, 011, 100, 101 and 110.
Triangle starts:
  1;
  2;
  2,  2;
  2,  6;
  2, 12,  2;
  2, 20, 10;
  2, 30, 30, 2;
  ...
		

Crossrefs

Programs

  • GAP
    Concatenation([1],Flat(List([1..15],n->List([0..Int(n/2)],k->2*Binomial(n,2*k))))); # Muniru A Asiru, Dec 20 2018
  • Maple
    T:=proc(n,k) if n=0 and k=0 then 1 else 2*binomial(n,2*k) fi end: for n from 0 to 15 do seq(T(n,k),k=0..floor(n/2)) od; # yields sequence in triangular form
  • Mathematica
    T[0,0]:=1; T[n_,k_]:= 2*Binomial[n,2k]; Table[T[n,k],{n,0,15},{k,0,Floor[n/2]}]//Flatten (* Stefano Spezia, Apr 19 2025 *)

Formula

T(n,k) = 2*binomial(n,2k) for n >= 1; T(0,0) = 1.
T(n,k) = 2*T(n-1,k) - T(n-2,k) + T(n-2,k-1) for n >= 3.
G.f.: (1 - z^2 + t*z^2)/(1 - 2*z + z^2 - t*z^2).
T(n,0) = 2 for n >= 1.
T(n,1) = 2*binomial(n,2) = A002378(n-1).
T(n,2) = 2*binomial(n,4) = A034827(n).
T(n,k) = 2*A034839(n-1,k) for n >= 1. [Corrected by Georg Fischer, May 28 2023]
Sum_{k=0..floor(n/2)} k*T(n,k) = A057711(n).

A173622 Triangle T(n,m) read by rows: The number of m-Schroeder paths of order n with 2 diagonal steps.

Original entry on oeis.org

1, 6, 21, 30, 180, 546, 140, 1430, 6120, 17710, 630, 10920, 65835, 245700, 695640, 2772, 81396, 690690, 3322704, 11515140, 32212719, 12012, 596904, 7125300, 44170896, 187336380, 619851960, 1721286532, 51480, 4326300, 72624816
Offset: 2

Views

Author

R. J. Mathar, Nov 08 2010

Keywords

Comments

The case with 1 diagonal step is A060543.

Examples

			This is the left-lower portion of the array which starts in row n=2, columns m>=1 as:
1, 2, 3, 4, 5, 6,..
6, 21, 45, 78, 120, 171, 231,.. # A081266
30, 180, 546, 1224, 2310, 3900, 6090, 8976,.. # bisection A055112
140, 1430, 6120, 17710, 40950, 81840, 147630, 246820, 389160,.. # 5-section A034827
630, 10920, 65835, 245700, 695640, 1645020, 3426885, 6497400, ...
2772, 81396, 690690, 3322704, 11515140, 32212719, 77481495, ...
12012, 596904, 7125300, 44170896, 187336380, 619851960, ...
		

References

  • Chunwei Song, The Generalized Schroeder Theory, El. J. Combin. 12 (2005) #R53 Theorem 2.1.

Formula

T(n,m) = trinomial(m*n+n-2; m*n-2,n-2,2)/(m*n-1) .

A189913 Triangle read by rows: T(n,k) = binomial(n, k) * k! / (floor(k/2)! * floor((k+2)/2)!).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 3, 1, 4, 6, 12, 2, 1, 5, 10, 30, 10, 10, 1, 6, 15, 60, 30, 60, 5, 1, 7, 21, 105, 70, 210, 35, 35, 1, 8, 28, 168, 140, 560, 140, 280, 14, 1, 9, 36, 252, 252, 1260, 420, 1260, 126, 126, 1, 10, 45, 360, 420, 2520, 1050, 4200, 630, 1260, 42
Offset: 0

Views

Author

Peter Luschny, May 24 2011

Keywords

Comments

The triangle may be regarded a generalization of the triangle A097610:
A097610(n,k) = binomial(n,k)*(2*k)$/(k+1);
T(n,k) = binomial(n,k)*(k)$/(floor(k/2)+1).
Here n$ denotes the swinging factorial A056040(n). As A097610 is a decomposition of the Motzkin numbers A001006, a combinatorial interpretation of T(n,k) in terms of lattice paths can be expected.
T(n,n) = A057977(n) which can be seen as extended Catalan numbers.

Examples

			[0]  1
[1]  1, 1
[2]  1, 2,  1
[3]  1, 3,  3,   3
[4]  1, 4,  6,  12,  2
[5]  1, 5, 10,  30, 10,  10
[6]  1, 6, 15,  60, 30,  60,  5
[7]  1, 7, 21, 105, 70, 210, 35, 35
		

Crossrefs

Row sums are A189912.

Programs

  • Magma
    /* As triangle */ [[Binomial(n,k)*Factorial(k)/(Factorial(Floor(k/2))*Factorial(Floor((k + 2)/2))): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Jan 13 2018
  • Maple
    A189913 := (n,k) -> binomial(n,k)*(k!/iquo(k,2)!^2)/(iquo(k,2)+1):
    seq(print(seq(A189913(n,k),k=0..n)),n=0..7);
  • Mathematica
    T[n_, k_] := Binomial[n, k]*k!/((Floor[k/2])!*(Floor[(k + 2)/2])!); Table[T[n, k], {n, 0, 10}, {k, 0, n}]// Flatten (* G. C. Greubel, Jan 13 2018 *)
  • PARI
    {T(n,k) = binomial(n,k)*k!/((floor(k/2))!*(floor((k+2)/2))!) };
    for(n=0,10, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jan 13 2018
    

Formula

From R. J. Mathar, Jun 07 2011: (Start)
T(n,1) = n.
T(n,2) = A000217(n-1).
T(n,3) = A027480(n-2).
T(n,4) = A034827(n). (End)

A213380 a(n) = 132*binomial(n,12).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 1716, 12012, 60060, 240240, 816816, 2450448, 6651216, 16628040, 38798760, 85357272, 178474296, 356948592, 686439600, 1274816400, 2294669520, 4015671660, 6850263420, 11417105700, 18627909300, 29804654880, 46835886240, 72382733280, 110147637600, 165221456400, 244527755472, 357386719536, 516225261552, 737464659360
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2012. This sequence was in the 1973 "Handbook", but was later dropped from the database. I have now reinstated it. - N. J. A. Sloane, Jun 10 2012

Keywords

References

  • Charles Jordan, Calculus of Finite Differences, Chelsea 1965, p. 450.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Programs

Formula

G.f.: -132*x^12 / (x-1)^13. - Colin Barker, Jul 22 2013
a(n) = 132*A010965(n). - R. J. Mathar, Jul 15 2015

A360665 Square array T(n, k) = k*((2*n-1)*k+1)/2 read by rising antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, -1, 0, 2, 3, -3, 0, 3, 7, 6, -6, 0, 4, 11, 15, 10, -10, 0, 5, 15, 24, 26, 15, -15, 0, 6, 19, 33, 42, 40, 21, -21, 0, 7, 23, 42, 58, 65, 57, 28, -28, 0, 8, 27, 51, 74, 90, 93, 77, 36, -36, 0, 9, 31, 60, 90, 115, 129, 126, 100, 45, -45
Offset: 0

Views

Author

Paul Curtz, Mar 17 2023

Keywords

Examples

			By rows:
   0,   0,  -1,  -3,  -6,  -10,  -15,  -21,  -28, ...   = -A161680
   0,   1,   3,   6,  10,   15,   21,   28,   36, ...   =  A000217
   0,   2,   7,  15,  26,   40,   57,   77,  100, ...   =  A005449
   0,   3,  11,  24,  42,   65,   93,  126,  164, ...   =  A005475
   0,   4,  15,  33,  58,   90,  129,  175,  228, ...   =  A022265
   0,   5,  19,  42,  74,  115,  165,  224,  292, ...   =  A022267
   0,   6,  23,  51,  90,  140,  201,  273,  356, ...   =  A022269
   ... .
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := ((2*n - 1)*k^2 + k)/2; Table[T[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Mar 31 2023 *)
  • PARI
    T(n, k) = ((2*n-1)*k^2+k)/2 \\ Thomas Scheuerle, Mar 17 2023

Formula

T(n,k) = T(n,k-1)+k^2.
T(n,n) = A081436(n-1).
T(n,n+1) = A059270(n).
T(n,n+4) = -3*A179297(n+4).
T(n+3,n) = A162254(n).
T(n+5,n) = 3*A101986(n).
From Stefano Spezia, Mar 31 2023: (Start)
O.g.f.: (x*y - y^2 + 2*x*y^2)/((1 - x)^2*(1 - y)^3).
E.g.f.: exp(x+y)*y*(2*x - y + 2*x*y)/2. (End)

A361226 Square array T(n,k) = k*((1+2*n)*k - 1)/2; n>=0, k>=0, read by antidiagonals upwards.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 2, 5, 3, 0, 3, 9, 12, 6, 0, 4, 13, 21, 22, 10, 0, 5, 17, 30, 38, 35, 15, 0, 6, 21, 39, 54, 60, 51, 21, 0, 7, 25, 48, 70, 85, 87, 70, 28, 0, 8, 29, 57, 86, 110, 123, 119, 92, 36, 0, 9, 33, 66, 102, 135, 159, 168, 156, 117, 45
Offset: 0

Views

Author

Paul Curtz, Mar 05 2023

Keywords

Comments

The main diagonal is A002414.
The first upper diagonal is A160378(n+1).
The antidiagonals sums are A034827(n+2).
b(n) = (A034827(n+3) = 0, 2, 10, 30, 70, ...) - (A002414(n) = 0, 1, 9, 30, 70, ...) = 0, 1, 1, 0, 0, 5, 21, 56, ... .
b(n+2) = A299120(n). b(n+4) = A033275(n). b(n+4) - b(n) = A002492(n).

Examples

			The rows are
  0, 0,  1,  3,  6,  10,  15,  21, ...   = A161680
  0, 1,  5, 12, 22,  35,  51,  70, ...   = A000326
  0, 2,  9, 21, 38,  60,  87, 119, ...   = A005476
  0, 3, 13, 30, 54,  85, 123, 168, ...   = A022264
  0, 4, 17, 39, 70, 110, 159, 217, ...   = A022266
  ... .
Columns: A000004, A001477, A016813, A017197=3*A016777, 2*A017101, 5*A016873, 3*A017581, 7*A017017, ... (coefficients from A026741).
Difference between two consecutive rows: A000290. Hence A143844.
This square array read by antidiagonals leads to the triangle
  0
  0   0
  0   1   1
  0   2   5   3
  0   3   9  12   6
  0   4  13  21  22  10
  0   5  17  30  38  35  15
  ... .
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := k*((2*n + 1)*k - 1)/2; Table[T[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Mar 05 2023 *)
  • PARI
    a(n) = { my(row = (sqrtint(8*n+1)-1)\2, column = n - binomial(row + 1, 2)); binomial(column, 2) + column^2 * (row - column) } \\ David A. Corneth, Mar 05 2023
    
  • Python
    # Seen as a triangle:
    from functools import cache
    @cache
    def Trow(n: int) -> list[int]:
        if n == 0: return [0]
        r = Trow(n - 1)
        return [r[k] + k * k if k < n else r[n - 1] + n - 1 for k in range(n + 1)]
    for n in range(7): print(Trow(n)) # Peter Luschny, Mar 05 2023

Formula

Take successively sequences n*(n-1)/2, n*(3*n-1)/2, n*(5*n-1)/2, ... listed in the EXAMPLE section.
G.f.: y*(x + y)/((1 - y)^3*(1 - x)^2). - Stefano Spezia, Mar 06 2023
E.g.f.: exp(x+y)*y*(2*x + y + 2*x*y)/2. - Stefano Spezia, Feb 21 2024
Previous Showing 21-27 of 27 results.