Skip to contents

\(B_n\) counts partitions of an \(n\)-set into any number of blocks, so \(B_n = \sum_k S(n,k)\). The triangle is used instead of that sum because it needs only additions.

Usage

morie_bell_number(n)

Arguments

n

Non-negative whole number.

Value

A morie_bigint.

Details

\(B_{25} = 4638590332229999353\), past the exact range of a double, which is why this returns a morie_bigint.

References

Stanley RP (2011) vol. 1, Sec 1.9.

Examples

morie_bell_number(n = 5L)
#> 52