I need help finding a general formula for this specific problem-
$$(a_1+a_2+a_3+...+a_n)= x, \ \ \ a_1,a_2,a_3,...,a_n∈[0,x] $$
How many permutations/combinations of this sum can be formed? (all positive integers and repetition allowed)
Here's an example where $x=2$ and $n=3$.
$$a_1+a_2+a_3=2, \ \ \ \ a_1,a_2,a_3\in[0,2]$$
$0+0+2 ...(1)$
$0+2+0 ...(2)$
$2+0+0 ...(3)$
$1+1+0 ...(4)$
$1+0+1 ...(5)$
$0+1+1 ...(6)$
Hence total $6$ combinations, but I can't seem to figure out a general formula for this.
By the way, this is my first question here so please excuse my unprofessional questioning.
This is just stars and bars concept.stars and bars
If you want a formula then okay. Here it is
$\binom{n+x-1}{x}$