Consider the diophantine equation $$x_1+3x_2+5x_3 = n$$ where $x_i\geq 0$ and $n\geq 1.$ Let $P_n(1,3,5)$ denote the number of solutions to this equation. I want to express $P_n(1,3,5)$ in terms of $P_{1}(1,3,5), P_{2}(1,3,5),\cdots, P_{n-1}(1,3,5).$
Here is what I observed:
If $(x_1,x_2,x_3)$ is a solution to $$x_1+3x_2+5x_3 = k$$ then $(x_1+1,x_2,x_3)$ is a solution to $$x_1+3x_2+5x_3 = k+1$$ $(x_1,x_2+1,x_3)$ is a solution to $$x_1+3x_2+5x_3 = k+3$$ and $(x_1,x_2,x_3+1)$ is a solution to $$x_1+3x_2+5x_3 = k+5.$$ But I don't know know how to combine this to get the desired relation. Any ideas will be much appreciated.
Edit: Based on the answer given below, we observe that a solution (x_1,x_2,x_3) to $$x_1+3x_2+5x_3 = n$$ must have $x_1>0$ or $x_2>0$ or $x_3>0.$ If $x_1>0$ then (x_1-1,x_2,x_3) is a solution $$x_1+3x_2+5x_3 = n-1$$ and there are $P_{n-1}(1,3,5).$ Proceeding in a similar manner for $x_2$ and $x_3$ and applying the inclusion-exclusion principle we get: $$P_{n}(1,3,5) = P_{n-1}(1,3,5)+P_{n-3}(1,3,5)+P_{n-5}(1,3,5)-P_{n-4}(1,3,5)-P_{n-8}(1,3,5)-P_{n-6}(1,3,5)+P_{n-9}(1,3,5).$$
Let's do a simpler example: $P_n(2,3)$, the number of solutions to $2x+3y=n$ in nonnegative integers. For $n>0$ a solution must have either $x>0$ or $y>0$. A solution with $x>0$ means that $(x-1,y)$ is a solution to $2X+3Y=n-2$ so there are $P_{n-2}(2,3)$ of these. Likewise there are $P_{n-3}(2,3)$ solutions with $y>0$. But some solutions have $x>0$ and $y>0$, and there are $P_{n-5}(2,3)$ of these. By the inclusion/exclusion principle, $$P_n(2,3)=P_{n-2}(2,3)+P_{n-3}(2,3)-P_{n-5}(2,3).$$
In your example, you'll have to do three-fold inclusion/exclusion...