I have come across numerous questions where I am asked for example, if $x$ and $y$ are non-negative integers and $3x + 4y = 96$, how many pairs of $(x,y)$ are there?
Usually, I just use trial and error and look at the multiples of $3$ and $4$. However, I was wondering whether there is a more efficient way to solve such problems.
Help would be appreciated.
Thank you :)
Noth that $3x=4(24-y)$ implies that $x$ has to be a multiple of $4$, i.e. $x=4k$. Then, $3\cdot 4k=4(24-y)\Rightarrow 3k=24-y\Rightarrow y=24-3k$. Since $y$ is non-negative, one has $24-3k\ge 0\Rightarrow 0\le k\le8$. Note that the number of pairs $(x,y)$ is the same as the number of $k$, i.e. $\color{red}{9}$.