Re: Primary school problem!

This is how I would go about it:

Let $\displaystyle 2\le x$ be the number of balloons with 3 spots and $\displaystyle 2\le y$ be the number of balloons with 5 spots. We then have:

$\displaystyle 3x+5y=k$ where $\displaystyle k$ in the total number of spots.

Next, I would let:

$\displaystyle x=5n+a$ and $\displaystyle y=b-3n$ and so there results:

$\displaystyle 3(5n+a)+5(b-3n)=k$

$\displaystyle 3a+5b=k$

Now, we want to find a specific instance that works for a particular $\displaystyle k$.

In the case of $\displaystyle k=31$, I would begin taking multiples of 5 away from 31 until I have a multiple of 3. In this case:

$\displaystyle 31-2(5)=21=3(7)$ and so we find:

$\displaystyle 3(7)+5(2)=31$ hence:

$\displaystyle a=7,\,b=2$ and thus:

$\displaystyle x=5n+7$ and $\displaystyle y=2-3n$

We know $\displaystyle n=0$ produces a valid solution $\displaystyle (x,y)=(7,2)$, but $\displaystyle n=1$ does not, so going in the other direction we find:

$\displaystyle n=-1\rightarrow(x,y)=(2,5)$

But, $\displaystyle n=-2$ produces an invalid solution, so we know we have found the only two solutions that work.

A similar process can be done for the other two values of $\displaystyle k$.