Function Repository Resource:

LahL

Source Notebook

Evaluate the Lah number

Contributed by: Jan Mangaldan

ResourceFunction["LahL"][n,m]

gives the Lah number L(n,m).

Details

Integer mathematical function, suitable for both symbolic and numerical manipulation.
L(n,m) gives the number of ways of partitioning a set of n elements into m non-empty linearly ordered subsets.
ResourceFunction["LahL"] automatically threads over lists.

Examples

Basic Examples (1) 

Evaluate some Lah numbers:

In[1]:=
Table[ResourceFunction["LahL"][10, m], {m, 10}]
Out[1]=

Scope (1) 

LahL threads elementwise over lists:

In[2]:=
ResourceFunction["LahL"][{2, 4, 6}, 2]
Out[2]=

Applications (3) 

Plot Lah numbers on a logarithmic scale:

In[3]:=
ListPlot3D[
 Table[Log[Abs[ResourceFunction["LahL"][n, m]] + 1], {n, 60}, {m, 60}]]
Out[3]=

Express Pochhammer as a linear combination of FactorialPower:

In[4]:=
With[{n = 7},
   Pochhammer[x, n] == \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(m = 1\), \(n\)]\(\*
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"LahL\"\>", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[0.968627, 0.976471, 0.984314],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[0.831373, 0.847059, 0.85098],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
           "\"LahL\""},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["LahL"],
BoxID -> "LahL",
Selectable->False][n, m] FactorialPower[x, m]\)\)] // FunctionExpand // Simplify
Out[4]=

Express FactorialPower as a linear combination of Pochhammer:

In[5]:=
With[{n = 7},
   FactorialPower[x, n] == \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(m = 1\), \(n\)]\(
\*SuperscriptBox[\((\(-1\))\), \(n - m\)] \*
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"LahL\"\>", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[0.968627, 0.976471, 0.984314],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[0.831373, 0.847059, 0.85098],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
           "\"LahL\""},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["LahL"],
BoxID -> "LahL",
Selectable->False][n, m] Pochhammer[x, m]\)\)] // FunctionExpand // Simplify
Out[5]=

Closed form of derivatives of 1/x:

In[6]:=
D[Exp[1/x], {x, 6}] // Factor
Out[6]=
In[7]:=
With[{n = 6}, (-1)^n Exp[1/x] \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(k = 1\), \(n\)]\*
FractionBox[
RowBox[{
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"LahL\"\>", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[0.968627, 0.976471, 0.984314],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[0.831373, 0.847059, 0.85098],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
          "\"LahL\""},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["LahL"],
BoxID -> "LahL",
Selectable->False], "[", 
RowBox[{"n", ",", "k"}], "]"}], 
SuperscriptBox["x", 
RowBox[{"n", "+", "k"}]]]\)] // Factor
Out[7]=

Properties and Relations (3) 

Generate values from the generating function:

In[8]:=
Table[12!/m! SeriesCoefficient[Series[(t/(1 - t))^m, {t, 0, 12}], 12], {m, 5}]
Out[8]=
In[9]:=
Table[ResourceFunction["LahL"][12, m] , {m, 5}]
Out[9]=

Lah numbers can be expressed in terms of Stirling numbers of both kinds:

In[10]:=
Table[\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(n\)]\(
\*SuperscriptBox[\((\(-1\))\), \(n - j\)] StirlingS1[n, j] StirlingS2[
    j, m]\)\), {n, 5}, {m, n}]
Out[10]=
In[11]:=
Table[ResourceFunction["LahL"][n, m], {n, 5}, {m, n}]
Out[11]=

Lah numbers are given by a partial Bell polynomial with factorial arguments:

In[12]:=
Table[BellY[n, m, Table[k!, {k, n}]], {n, 5}, {m, n}]
Out[12]=
In[13]:=
Table[ResourceFunction["LahL"][n, m], {n, 5}, {m, n}]
Out[13]=

Version History

  • 1.0.0 – 17 May 2021

Source Metadata

Related Resources

License Information