3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
source | link

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

table of associated Stirling numbers

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}]

plot of GF

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

plot of GF

References:

  1. 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

table of associated Stirling numbers

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}]

plot of GF

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

plot of GF

References:

  1. 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

table of associated Stirling numbers

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}]

plot of GF

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

plot of GF

References:

  1. L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.
2 added 27 characters in body
source | link

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

enter image description heretable of associated Stirling numbers

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}]

enter image description hereplot of GF

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

enter image description hereplot of GF

ReferencesReferences:

  1. 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

enter image description here

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}]

enter image description here

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

enter image description here

References:

  1. 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

table of associated Stirling numbers

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}]

plot of GF

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

plot of GF

References:

  1. L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.
1
source | link

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

enter image description here

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}]

enter image description here

Plot3D[{G[1, u, t, 20], G[2, u, t, 20], G[3, u, t, 20]}, {u, -1, 1}, {t, -1, 1}]

enter image description here

References:

  1. L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.