Number of solutions of $x+y=2n$ and of $x+y+2z=n$

141 Views Asked by At

Could anyone explain how to solve this problem please.

Let $n$ be an odd integer and $$n\ge5$$

  1. find the number of pairs $(x,y)$ of positive integer which satisfy the equation $$ x+2y=n$$
  2. find the number of triple $(x,y,z)$ of positive integer which satisfy the equation $$x+y+2z=n$$
1

There are 1 best solutions below

0
On

For question 1, it is enough to deduce all the possible values for $x$, since for a fixed $x$ there is only one $y$. Since $n$ is odd and $2y$ is even, it follows that $x$ is odd. If you do not allow $0$ values, then $x\in\{1,3,\dots,n-2\}$, therefore $(n-1)/2$ solutions. If you allow $0$ values, then $x\in\{1,3,\dots,n\}$, therefore $(n+1)/2$ solutions.

Let us introduce a new question (1b):

Let $m$ be an even integer and $m≥4$ find the number of pairs $(x,y)$ of positive integers which satisfy the equation $x+2y=m$. Since $m$ is even and $2y$ is even, it follows that $x$ is even. If you do not allow $0$ values, then $x\in\{0,2,\dots,m-2\}$, therefore $m/2$ solutions. If you allow $0$ values, then $x\in\{0,2,\dots,m\}$, therefore $(m+2)/2$ solutions.

For question 2, (I assume you are allowed 0 values; you can work out the other case) $x\in\{0,1,\dots,n\}$. If $x=0$, the problem is reduced to the first one, therefore $(n+1)/2$ solutions. If $x=1$, the problem is reduced to question 1b, for $m=n-1$, therefore $(n+1)/2)$ solutions. Therefore for $x\in\{0,1\}$, you have $n+1$ solutions. With similar reasoning, you get that for $x\in\{2,3\}$, you have $n-1$ solutions. For the final step, for $x\in\{n-1,n\}$, you have two solutions, therefore, in total, you have $(n+1)+(n-1)+\dots+2=2(1+\dots+(n+1)/2)=(n+1)(n+3)/4$.

Hope the computations are correct.