Stirling numbers of the second kind, or Stirling partition numbers, are the
number of ways to partition a set of n objects into k non-empty subsets. They are
closely related to Bell numbers, and may be derived from them.



Stirling numbers of the second kind obey the recurrence relation:

   S2(n, 0) and S2(0, k) = 0 # for n, k > 0
   S2(n, n) = 1
   S2(n + 1, k) = k * S2(n, k) + S2(n, k - 1)



Task

 Write a routine (function, procedure, whatever) to find Stirling numbers of the second kind. There are several methods to generate Stirling numbers of the second kind. You are free to choose the most appropriate for your language. If your language has a built-in, or easily, publicly available library implementation, it is acceptable to use that.
 Using the routine, generate and show here, on this page, a table (or triangle) showing the Stirling numbers of the second kind, S2(n, k), up to S2(12, 12). it is optional to show the row / column for n == 0 and k == 0. It is optional to show places where S2(n, k) == 0 (when k > n).
 If your language supports large integers, find and show here, on this page, the maximum value of S2(n, k) where n == 100.


See also

 Wikipedia - Stirling numbers of the second kind
 OEIS:A008277 - Stirling numbers of the second kind


Related Tasks

 Stirling numbers of the first kind
 Bell numbers
 Lah numbers


with javascript_semantics 
include mpfr.e
 
constant lim = 100,
         lim1 = lim+1,
         last = 12
sequence s2 = repeat(0,lim1)
for n=1 to lim1 do
    s2[n] = mpz_inits(lim1)
    mpz_set_si(s2[n][n],1)
end for
mpz {t, m100} = mpz_inits(2)
for n=1 to lim do
    for k=1 to n do
        mpz_set_si(t,k)
        mpz_mul(t,t,s2[n][k+1])
        mpz_add(s2[n+1][k+1],t,s2[n][k])
    end for
end for
printf(1,"Stirling numbers of the second kind: S2(n, k):\n n   k:")
for i=0 to last do
    printf(1,"%5d     ", i)
end for
printf(1,"\n---    %s\n",repeat('-',last*10+5))
for n=0 to last do
    printf(1,"%2d ", n)
    for k=1 to n+1 do
        printf(1,"%9s ",{mpz_get_str(s2[n+1][k])})
    end for
    printf(1,"\n")
end for
for k=1 to lim1 do
    mpz s100k = s2[lim1][k] 
    if mpz_cmp(s100k,m100) > 0 then
        mpz_set(m100,s100k)
    end if
end for
printf(1,"\nThe maximum S2(100,k): %s\n",shorten(mpz_get_str(m100)))
