Maybe I'm missing something but you are simply solving an equation of the form:
x1 + x2 + x3 + ... + xr = n
ie. placing n pidgeons into r holes (d/w im not gonna use pidgeon hole principle, its just an analogy
)
now since we have the condition that xi > 0
we solve:
y1 + y2 + y3 + ... + yr = (n - r)
[where we have taken into account that every hole MUST have a pigeon, and as such reformulated the problem to consider the r holes and (n - r) remaining pidgeons]
the number of solutions to such a problem is:
(n - r + r - 1) C (r - 1)
= (n - 1) C (r - 1)
unless i misunderstood the problem ;d