Function Repository Resource:

MotzkinM

Source Notebook

Evaluate the Motzkin number

Contributed by: Jan Mangaldan

ResourceFunction["MotzkinM"][n]

gives the Motzkin number Mn.

Details

Integer mathematical function, suitable for both symbolic and numerical manipulation.
Mn counts the number of different ways of drawing non-intersecting chords between n points on a circle.
ResourceFunction["MotzkinM"] automatically threads over lists.

Examples

Basic Examples (2) 

Compute MotzkinM of 10:

In[1]:=
ResourceFunction["MotzkinM"][10]
Out[1]=

Plot the sequence:

In[2]:=
DiscretePlot[ResourceFunction["MotzkinM"][n], {n, 0, 10}, PlotRange -> All]
Out[2]=

Scope (1) 

MotzkinM threads over lists:

In[3]:=
ResourceFunction["MotzkinM"][{2, 4, 7}]
Out[3]=

Applications (1) 

Logarithmic plot of MotzkinM:

In[4]:=
ListLinePlot[Log10[ResourceFunction["MotzkinM"][Range[100]]]]
Out[4]=

Properties and Relations (3) 

MotzkinM satisfies a recurrence relation:

In[5]:=
RecurrenceTable[{(\[FormalN] + 2) \[FormalM][\[FormalN]] == (2 \[FormalN] + 1) \[FormalM][\[FormalN] - 1] + 3 (\[FormalN] - 1) \[FormalM][\[FormalN] - 2], \[FormalM][
    0] == \[FormalM][1] == 1}, \[FormalM], {\[FormalN], 0, 10}]
Out[5]=
In[6]:=
ResourceFunction["MotzkinM"][Range[0, 10]]
Out[6]=

Compute a Motzkin number from its generating function:

In[7]:=
SeriesCoefficient[2/(1 - x + Sqrt[1 - 2 x - 3 x^2]), {x, 0, 11}]
Out[7]=
In[8]:=
ResourceFunction["MotzkinM"][11]
Out[8]=

Express MotzkinM in terms of Binomial and CatalanNumber:

In[9]:=
With[{n = 11}, \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(Quotient[n, 2]\)]\(CatalanNumber[j] Binomial[n, 2  j]\)\)]
Out[9]=
In[10]:=
ResourceFunction["MotzkinM"][11]
Out[10]=

Version History

  • 1.0.0 – 17 May 2021

Source Metadata

Related Resources

License Information