Consider the diophantine equation of the form $$a_1x_1+a_2x_2+\cdots +a_kx_k=n$$ where $n,k\geq 1$ and $a_i$ are non-negative integers. Then we are concerned $v(n)$ denote the number of solutions for a fixed tuple $(a_1,a_2,\cdots ,a_k).$ Can $v(n)$ be expressed recursively, that is, in terms of $v(n-1),v(n-2),$ etc?
I considered the following example to see if I could generalize $$x_1+2x_2 = n.$$ I noticed that if $(x_1,x_2)$ is a solution of $x_1+2x_2 = n-k$ then $(x_1+k,x_2)$ is a solution of $x_1+2x_2=n.$ Furthermore for $k=2p$ then if $x_1+2x_2 = n-k=n - 2p$ then $(x_1,x_2+p)$ is a solution of $x_1+2x_2=n.$ Therefore, $$v(n) = \sum_{k=1}^{n}v(n-k)+v(n-2)+v(n-4)+\cdots $$
Is this correct? How do I get a general formula for $v(n)?$ Any ideas will be much appreciated?