How many integral solutions does $2x + 3y + 5z = 900$ have when $ x, y, z \ge 0$? Solution: Let $2x + 3y = u.$ Then we must solve $\begin{align} u + 5z = 900 \tag 1 \\ 2x + 3y = u \tag 2 \end{align}$
For $(1),$ a particular solution is $(u_0, z_0) = (0, 180).$ Hence, all the integral solutions of $(1)$ are $\begin{cases} u = 5t \\ z = 180 - t \end{cases} (t \in \mathbb Z)$
Substituting $u = 5t$ into $(2)$ gives $2x + 3y = 5t$ whose particular solution is $(x_0, y_0) = (t, t).$ Hence all the integral solutions of $(2)$ are $\begin{cases} x = t - 3s \\ y = t + 2s \end{cases} (t \in \mathbb Z)$
Thus all the integral solutions of $2x + 3y + 5z = 900$ are given by $$\begin{cases} x = t - 3s \\ y = t + 2s \\ z = 180 - t \end{cases} (s,t \in \mathbb Z)$$
Now suppose $x, y, z \ge 0.$ 
Note, $180 - t \ge 0 \implies t \le 180$ and so $t + 2s \ge 0 \implies s \ge -90$ and $t - 3s \ge 0 \implies s \le 60.$ Thus we have $-90 \le s \le 60.$ 
Consider $0 \le s \le 60.$ Now $t \le 180, \ t \ge 3s \implies 3s \le t \le 180$. Thus in this range of $s$, there are $180 - 3s + 1 = 181 - 3s$ of $t$'s.
Consider $-90 \le s < 0.$ Now $t \le 180, \ t \ge -2s \implies -2s \le t \le 180$. Thus in this range of $s$, there are $180 + 2s + 1 = 181 + 2s$ of $t$'s.
Range $0 \le s \le 60$ has the following points:
$(0, 181 - 3(0)), \ (1, 181 - 3(1)), (2, 181 - 3(2), \ldots (60, 181 - 3(60))$ of which there are $61.$
The range $-90 \le s < 0$ must have $91$ points. In sum, we have $61 + 91 = 152$ points for $x, y, z \ge 0.$
My question:
According to the book the answer is $\displaystyle{\sum_{s = 0}^{60}(181 - 3s) + \sum_{s = -90}^{-1}(181 + 2s) = 13651.}$ I don't understand why they took the sum of all $t$'s in the range of $s$. That means some of my denotations and labels above must be incorrect. Where's the mistake? Thanks.
edit: 
I think I see my mistake. The number $181 - 3s$ is the number of $t$'s, not necessarily the form of $t$. Given that, the number of ordered pairs (in the given range) must be $(181 - 3s)*61$ by the product rule.

You can solve this problem by creating equals Ax = b. Where A - transition matrix by x and b.
Let's consider this example.
Introduce F(m, i) where F(m, 1) - count of solutions 2x = m, F(m, 2) - count of solutions 2x + 3y = m, F(m, 3) - count of solution 2x + 3y + 5z = m ...
The following equations are valid:
F(m, 1) = F(m - 2, 1)
F(m, 2) = F(m, 1) + F(m - 3, 2) = F(m - 2, 1) + F(m - 3, 2)
F(m, 3) = F(m, 2) + F(m - 5, 3) = F(m - 2, 1) + F(m - 3, 2) + F(m - 5, 3)
Vector b we can construct as [F(m, 1), F(m - 1, 1), F(m, 2), F(m - 1, 2), F(m - 2, 2), F(m, 3), F(m - 1, 3), F(m - 2, 3), F(m - 3, 3), F(m - 4, 3)].
Vector x we can construct as [F(m - 1, 1), F(m - 2, 1), F(m - 1, 2), F(m - 2, 2), F(m - 3, 2), F(m - 1, 3), F(m - 2, 3), F(m - 3, 3), F(m - 4, 3), F(m - 5, 3)].
Matrix A is easily constructed by x and b.
Start vector x is [F(0, 1), F(-1, 1), F(0, 2), F(-1, 2), F(-2, 2), F(0, 3), F(-1, 3), F(-2, 3), F(-3, 3), F(-4, 3)] and have value [1, 0, 1, 0, 0, 1, 0, 0, 0, 0]
And it's finish.
We interested in F(900, 3). We need calculate A^900 * x and take appropriate b[5].
We can raise the matrix to a power by O(2 * lb(900) * 10^3)
