Lah numbers
DefinitionUnsigned Lah number#✓fully proved
MetaMathlibExt.unsignedLahNumber
For natural numbers \(n\) and \(k\), the unsigned Lah number \(L(n, k)\) is \(\binom{n-1}{k-1} \frac{n!}{k!}\) when \(1 \le k \le n\), \(L(0, 0) = 1\), and \(L(n, k) = 0\) otherwise.
\(L(n, k)\) counts the partitions of an \(n\)-element set into \(k\) nonempty linearly ordered blocks.
def unsignedLahNumber : ℕ → ℕ → ℕ
| 0, 0 => 1
| 0, _ + 1 => 0
| _ + 1, 0 => 0
| n + 1, k + 1 =>
Nat.choose n k * Nat.factorial (n + 1) / Nat.factorial (k + 1)
Sources
Sources
- closed formula from Maxie D. Schmidt, Jacobi-Type Continued Fractions for the Ordinary Generating Functions of Generalized Factorial Functions, Journal of Integer Sequences 20 (2017): https://cs.uwaterloo.ca/journals/JIS/VOL20/Schmidt/schmidt14.tex.
Used by 1
Used bySigned Lah number
DefinitionSigned Lah number#✓fully proved
MetaMathlibExt.signedLahNumber
For natural numbers \(n\) and \(k\), the signed Lah number is the integer \((-1)^{n-k} L(n, k)\) when \(k \le n\), where \(L(n, k)\) is the unsigned Lah number, and \(0\) when \(k > n\).
def signedLahNumber (n k : ℕ) : ℤ :=
if k ≤ n then (-1 : ℤ) ^ (n - k) * unsignedLahNumber n k else 0
def unsignedLahNumber : ℕ → ℕ → ℕ
| 0, 0 => 1
| 0, _ + 1 => 0
| _ + 1, 0 => 0
| n + 1, k + 1 =>
Nat.choose n k * Nat.factorial (n + 1) / Nat.factorial (k + 1)
MathlibExt/Combinatorics/Enumerative/LahNumber.lean:25
Sources
Sources
- sign convention from Toufik Mansour, Matthias Schork, and Mark Shattuck, The Generalized Stirling and Bell Numbers Revisited, Journal of Integer Sequences 15 (2012): https://cs.uwaterloo.ca/journals/JIS/VOL15/Schork/schork2.tex.
Uses 1
Statement usesUnsigned Lah number
2 fully proved
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.