The number of ways to get $N$ as the sum of $R$ elements, except my solution must have no repetition ($3+2$ and $2+3$ counts for only $1$), and $0$ cannot be used.
For example, $N=8$, $R=2$, should return $4$. The four are $7+1, 6+2, 5+3, 4+4$.
Another example: $N=9, R=3$, should return $7$. The seven are $7+1+1, 6+2+1, 5+3+1, 5+2+2, 4+4+1, 4+3+2, 3+3+3$.
I'm looking for an equation that works for any $N$ and $R$.
I know that without the constraints the number of ways to get N as the sum of R elements) the solution is: $\frac{(N+R-1)!}{((R-1)!\times(N)!}$ or in other words: Combination $^{N+R-1} C _{R-1}$.
I also know that the total number of ways to sum to N with any number of elements is $2^{n-1} - 1$.