Approximation of a recursive function

349 Views Asked by At

Let $ f: (\mathbb{N}, \mathbb{N}) \to \mathbb{N} $ be defined recursively as follows:

  • $ f(0, 0) = 1 $

  • $ f(0, n) = 0 \quad $ for $ n > 0 $

  • $ f(s, n) = \sum_{k=0}^{n} \binom{n}{k} (n-k)^{n-k} f(s-1,k) \quad $ for $ s > 0 $

Using this definition, it is impractical to calculate $ f(s, n) $ for large $ s $ and $ n $, e.g. $ f(300, 10^6) $, even with a computer. Is there a closed-form approximation for $ f(s, n) $ or $ log \, f(s, n) $ that is easy to compute for large values?

For reference, here are some values of $ f(s, n) $:

 s|  0       1        2        3         4         5
n +-------------------------------------------------
0 |  1       1        1        1         1         1
1 |  0       1        2        3         4         5
2 |  0       4       10       18        28        40
3 |  0      27       78      159       276       435
4 |  0     256      824     1848      3496      5960
5 |  0    3125    10970    26595     54020     98345
6 |  0   46656   176112   456048    984384   1896480
7 |  0  823543  3309110  9073911  20655796  41828255

Background:

For all $ n $, $ f(1, n) = n^n $. $ f (2, n) $ is A063170 on OEIS and $ f(3, n) $ is A089901. (The higher columns don't seem to be on OEIS.) The diagonal is A239761.
$ f(s, n) $ can equivalently be defined as a combinatorial sum. Let the alphabet $ A_s $ be any set of size $ s $ . $ (A_s)^n $ is then the set of words over this alphabet with length $ n $ . Let $ count_w(a) $ be the number of occurrences of a character $ a $ in a word $ w $. Then we have:

$$ f(s, n) = \sum_{w \in (A_s)^n} \prod_{a \in A_s} count_w(a)^{count_w(a)} $$
$ 0^0 = 1 $ in this whole question.