I've recently taken an interest in nontransitive dice; specifically corrected Grime dice. I want to see how many other unique dice there are that follow the same criteria of having $5n$ sides (possible by either displaying each value twice on a d10 or four times on a d20) with values between $1$ and $9$ that add up to $25$ (possibly so that I can see if I can find another set of 5 dice with a more consistent pair of cyclical chains than the currently known set later, but that will be another question if I set about it).
So I want to find a formula that will tell me how many unique dice fit the criteria I put forth. Through manual work I think I've found that there are $72$ unique dice when $n=5$, $x=1$, $y=9$, and $z=25$; though I'm not 100% certain that I haven't missed any. I'll include the list that I've found so that people can double-check my work + manual method; if there's a way that I could format it to be easier to read while still not taking up too much space either please do suggest an edit:
1, 1, 5, 9, 9 1, 2, 4, 9, 9 1, 3, 3, 9, 9 2, 2, 3, 9, 9 1, 1, 6, 8, 9 1, 2, 5, 8, 9 1, 3, 4, 8, 9 2, 2, 4, 8, 9 2, 3, 3, 8, 9 1, 1, 7, 7, 9 1, 2, 6, 7, 9 1, 3, 5, 7, 9 1, 4, 4, 7, 9 2, 2, 5, 7, 9 2, 3, 4, 7, 9 3, 3, 3, 7, 9 1, 3, 6, 6, 9 1, 4, 5, 6, 9 2, 2, 6, 6, 9 2, 3, 5, 6, 9 2, 4, 4, 6, 9 3, 3, 4, 6, 9 1, 5, 5, 5, 9 2, 4, 5, 5, 9 3, 3, 5, 5, 9 3, 4, 4, 5, 9 4, 4, 4, 4, 9 1, 1, 7, 8, 8 1, 2, 6, 8, 8 1, 3, 5, 8, 8 1, 4, 4, 8, 8 2, 2, 5, 8, 8 2, 3, 4, 8, 8 3, 3, 3, 8, 8 1, 2, 7, 7, 8 1, 3, 6, 7, 8 1, 4, 5, 7, 8 2, 2, 6, 7, 8 2, 3, 5, 7, 8 2, 4, 4, 7, 8 3, 3, 4, 7, 8 1, 4, 6, 6, 8 1, 5, 5, 6, 8 2, 3, 6, 6, 8 2, 4, 5, 6, 8 3, 3, 5, 6, 8 3, 4, 4, 6, 8 2, 5, 5, 5, 8 3, 4, 5, 5, 8 4, 4, 4, 5, 8 1, 3, 7, 7, 7 1, 4, 6, 7, 7 1, 5, 5, 7, 7 2, 2, 7, 7, 7 2, 4, 5, 7, 7 3, 3, 5, 7, 7 3, 4, 4, 7, 7 1, 5, 6, 6, 7 2, 4, 6, 6, 7 2, 5, 5, 6, 7 3, 3, 6, 6, 7 3, 4, 5, 6, 7 4, 4, 4, 6, 7 3, 5, 5, 5, 7 4, 4, 5, 5, 7 1, 6, 6, 6, 6 2, 5, 6, 6, 6 3, 4, 6, 6, 6 3, 5, 5, 6, 6 4, 4, 5, 6, 6 4, 5, 5, 5, 6 5, 5, 5, 5, 5I'd like it if $n=5$ $x=1$ $y=9$ $z=25$ could be used to demonstrate formulas so that I can see what an easier way to arrive at my conclusion would have been and if I came to the correct conclusion. I'd also like examples using $n=6$ $x=1$ $y=6$ $z=21$ so that I can also see an answer that I didn't (attempt to) manually work out. If I'm using any incorrect tags or I'm not using a tag that I should be using, please let me know.
You can solve this problem with a bivariate generating function. Specific to your original problem, the number of dice with 5 sides between 1 and 9 adding up to 25 is the coefficient of $a^{25}b^5$ in the polynomial: $$\displaystyle\prod_{i=1}^9(1+a^ib+a^{2i}b^2+a^{3i}b^3+a^{4i}b^4+a^{5i}b^5)$$ In this polynomial, $i$ represents the value of a side, $a$ tracks the sum provided by sides with value $i$, and $b$ tracks the number of sides with value $i$. I calculate this coefficient to be 73, so I think you may be missing a candidate.
Using your notation for the more general problem, you are looking for the coefficient of $a^zb^n$ in the polynomial: $$\displaystyle\prod_{i=x}^y \sum_{j=0}^n a^{ij}b^j$$
Any computer algebra system can calculate these coefficients for you. I used the Magma online calculator, and for your second problem I found an answer of 32. The downside of this method is that it is not really constructive.
Update: Here is Magma code to perform the polynomial calculation: