3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ edited Apr 13 '17 at 12:55 You can define the $$r$$-associated Stirling numbers of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (http://mathematica.stackexchange.com/q/2639What does the construct f[x_] := f[x] = ... mean?). Example for $$r = 2$$ (it is correct[1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is[1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is the regularized incomplete gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid problems with 0^0. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222. You can define the $$r$$-associated Stirling numbers of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (http://mathematica.stackexchange.com/q/2639). Example for $$r = 2$$ (it is correct[1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is[1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is the regularized incomplete gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid problems with 0^0. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222. You can define the $$r$$-associated Stirling numbers of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (What does the construct f[x_] := f[x] = ... mean?). Example for $$r = 2$$ (it is correct[1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is[1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is the regularized incomplete gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid problems with 0^0. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222. 2 added 27 characters in body edited Jul 25 '16 at 14:36 J. M. will be back soon♦ 100k1010 gold badges317317 silver badges476476 bronze badges You can define the $$r$$-associated Stirling numbernumbers of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$$$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in MathematicaMathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (What does the construct f[x_] := f[x] = … mean?http://mathematica.stackexchange.com/q/2639). Example for $$r = 2$$ (it is correct [1][1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is [1][1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is the regularized incomplete gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid problems with 0^0 problem. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  ReferencesReferences: L. Comtet, Advanced CombinatoricsAdvanced Combinatorics, Reidel, 1974, p. 222p. 222. You can define $$r$$-associated Stirling number of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (What does the construct f[x_] := f[x] = … mean?). Example for $$r = 2$$ (it is correct [1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is [1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is regularized gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid 0^0 problem. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222. You can define the $$r$$-associated Stirling numbers of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (http://mathematica.stackexchange.com/q/2639). Example for $$r = 2$$ (it is correct[1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is[1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is the regularized incomplete gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid problems with 0^0. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222. 1 answered Oct 17 '14 at 21:00 ybeltukov 39.4k55 gold badges9595 silver badges193193 bronze badges You can define $$r$$-associated Stirling number of the second kind with the following recurrence relation (wiki): $$S_r(n+1, k)=k\ S_r(n, k)+\binom{n}{r-1}S_r(n-r+1, k-1)$$ The corresponding definition (with necessary special cases) in Mathematica is ClearAll[S]; S[_, 0, 0] = 1; S[r_, n_, 1] /; n >= r = 1; S[r_, n_, k_] /; r > 0 && n > 0 && k > 0 && n >= k r := S[r, n, k] = k S[r, n - 1, k] + Binomial[n - 1, r - 1] S[r, n - r, k - 1] S[___] = 0;  Here I use Condition (/;) and memoization (What does the construct f[x_] := f[x] = … mean?). Example for $$r = 2$$ (it is correct [1]) Table[S[2, n, k], {k, 6}, {n, 12}] // Grid  The generating function is [1] $$\sum_{k,n\ge1}S_r(n,k)u^k\frac{t^n}{n!} = \exp[u\exp(t)(1-Q(r,t))]$$ where $$Q(r,t) = \Gamma(r,t)/\Gamma(r)$$ is regularized gamma function. Let us check it. The straightforward summation up to nmax is ClearAll[G] G[r_, u_, t_, nmax_] := 1 + Sum[S[r, n, k] u^k t^n/n!, {n, nmax}, {k, nmax}]  1 is written separately to avoid 0^0 problem. The exact definition is G[r_, u_, t_] := Exp[u Exp[t] (1 - GammaRegularized[r, t])]  Plots: Plot3D[{G[1, u, t], G[2, u, t], G[3, u, t]}, {u, -1, 1}, {t, -1, 1}]  Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]  References: L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.