Let $n$ be a positive integer. If the equation $2x+2y+z=n$ has $28$ solutions, find the possible values of $n$.
I tried taking $2x$ as $a$, and then $2y$ as $b$, and then finding the possibilities. However, I am not sure about the approach I've used. A little hint would be appreciated.
$x$, $ y$ and $z$ belong to whole numbers.
Assume $x,y,z$ are required to be positive integers.
Consider two cases . . .
Case $(1)$:$\;n$ is even.
From the equation $2x+2y+z=n$, it follows that $z$ is also even.
Writing $z=2w$, and $n=2m$, for some positive integers $w,m$, we get \begin{align*} &2x+2y+z=n\\[4pt] \iff\;&2x+2y+2w=2m\\[4pt] \iff\;&x+y+w=m\\[4pt] \end{align*} By the Stars-and-Bars formula, the equation $$x+y+w=m$$ has exactly ${\large{\binom{m-1}{2}}}$ positive integer solution triples $(x,y,w)$, for any given positive integer value of $m$, hence \begin{align*} &{\small{\binom{m-1}{2}}}=28\\[4pt] \implies\;\;&{\small{\frac{(m-1)(m-2)}{2}}}=28\\[4pt] \implies\;\;&m^2-3m+2=56\\[4pt] \implies\;\;&m^2-3m-54=0\\[4pt] \implies\;\;&(m-9)(m+6)=0\\[4pt] \implies\;\;&m=9\\[4pt] \implies\;\;&n=18\\[4pt] \end{align*}
Case $(2)$:$\;n$ is odd.
From the equation $2x+2y+z=n$, it follows that $z$ is also odd.
Writing $z=2w-1$, and $n=2m-1$, for some positive integers $w,m$, we get \begin{align*} &2x+2y+z=n\\[4pt] \iff\;&2x+2y+(2w-1)=2m-1\\[4pt] \iff\;&x+y+w=m\\[4pt] \end{align*} As for case $(1)$, since $m$ is a positive integer such that the equation $$ x+y+w=m \qquad\qquad $$ has exactly $28$ positive integer solution triples $(x,y,w)$, it follows that $m=9$, hence $n=2m-1=17$.
Note:$\;$If $x,y,z$ are only required to be nonnegative integers, then using arguments analogous to the ones given above, we get $n=12$ or $n=11$.