auxiliary: Auxiliary functions for 'randtoolbox' package.
Description
Stirling numbers of the second kind
Usage
stirling(n)
Arguments
n
a positive integer.
Value
a vector with stirling numbers.
Details
stirling computes stirling numbers of second kind i.e.
$$Stirl_n^k = k * Stirl_{n-1}^k + Stirl_{n-1}^{k-1}$$
with $Stirl_n^1 = Stirl_n^n = 1$.
e.g.
$n = 0$, returns 1
$n = 1$, returns c(0,1)
$n = 2$, returns c(0,1,1)
$n = 3$, returns c(0,1,3,1)
$n = 4$, returns c(0,1,7,6,1)...
Go to wikipedia for more details.