Solutions of Diophantine Equations with Restricted Terms

46 Views Asked by At

For the equation $x_1+x_2+\dots+x_n=k$, I know that the total number of nonnegative solutions is ${k+n-1 \choose k}$. My question is how does the number of solutions change if all $x_i$ have to be even?

1

There are 1 best solutions below

0
On

If all $x_i$ are even then $x_i=2y_i$ for some nonnegative integer $y_i$, for each $i$. If $k$ is odd, then of course there is no solution. If $k$ is even then we have $$y_1+y_2+\cdots+y_n=\tfrac k2,$$ and the number of nonnegative solutions is $\tbinom{\tfrac k2+n-1}{n}$.

If all $x_i$ are odd, then $x_i=2y_i+1$ for some nonnegative integer $y_i$, for each $i$. If $k\not\equiv n\pmod{2}$ then of course there is no solution. If $k\equiv n\pmod{2}$, then we have $$y_1+y_2+\cdots+y_n=\frac{k-n}{2},$$ and the number of nonnegative solutions is $\tbinom{\tfrac{k-n}{2}+n-1}{n}=\tbinom{\tfrac{k+n}{2}-1}{n}$.