Number of solutions for $x[1] + x[2] + \ldots + x[n] =k$ Omg this is driving me crazy seriously, it's a subproblem for a bigger problem, and i'm stuck on it.
Anyways i need the number of ways to pick $x[1]$ ammount of objects type $1$, $x[2]$ ammount of objects type $2$, $x[3]$ ammounts of objects type $3$ etc etc such that $$x[1] + x[2] + \ldots x[n] = k\;.$$ Order of the objects of course doesn't matter.
I know there is a simple formula for this something like $\binom{k + n}n$ or something like that i just can't find it anywhere on google.

The formula is:
$$ {n+k-1 \choose k} $$
Here's a proof:
Create a vector with $n$ ones and $k$ zeros, in no particular order. Each permutation of this vector is a solution to $x_1 + x_2 + x_3 + \cdots + x_k = n$. $x_1$ equals the number of ones to the left of the first zero, $x_2$ equals the number of ones between the first and second zeros, $x_3$ equals the number of ones between the second and third zeros, and so on, with the $x_i$ corresponding to the number of ones before the $(i-1)^{th}$ and $i^{th}$ zeros. There is a one-to-one correspondence between this permutation and $x_1 + x_2 + x_3 + \cdots + x_k = n$. There are $\dfrac{(n+k-1)!}{n!(k-1)!}$ permutations of such a vector, so hence the equation follows. 
