What is the expression for putting $n$ indistinguishable balls into $k$ indistinguishable cells?

Solution 1:

According to the comments, it appears that what you're discussing are partitions of an integer.

There isn't a really "nice" way of explicitly computing these, but we have published a blog post that presents a somewhat simple technique using memoization; specifically, Euler's Pentagonal Formula. This was written by Paramanand Singh and may be found here.

If you want an asymptotic approximation, there is the Hardy-Ramanujan formula:

$$p(n) \sim \frac{1}{4n\sqrt 3}\exp\left(2\pi\sqrt{n/6}\right)$$