number of non-negative integer solutions of $ax+by+cz=k$
How to find the number of non-negative integer solutions of $2x+3y+z=21$ ?
Please Help , thanks in advance
The general problem of the title is somewhat complicated. The particular problem of the main post is straightforward.
There are $8$ possibilities for $y$, $y=0$ to $y=7$.
If $y=0$, we need to make up $21$ dollars in $2$ dollar coins and $1$ dollar coins. The number of $2$ dollar coins is $0$ to $10$, so there are $11$ possibilities.
If $y=1$, we want to make up $18$ dollars. The number of $2$ dollar coins is $0$ to $9$, so there are $10$ possibilities.
If $y=2$, the same reasoning gives $8$ possibilities.
If $y=3$ we get $7$ possibilities.
For $y=4$ and $y=5$, we get respectively $5$ possibilities and $4$.
For $y=6$ and $y=7$, we get respectively $2$ possibilities and $1$.
Add up.
Remark: For the specific problem, what is needed is counting that is organized enough to ensure that we do not miss anything, and that we do not double-count.
We can use the same basic reasoning to count the number of solutions of $2x+3y+z=6k$, $6k+1$, $6k+2$, $6k+3$, $6k+4$, and $6k+5$. For each of these we will get an explicit formula in terms of $k$.