Question 974845
Cookies are sold singly or in packages of 13 or 39. 
With this packaging, how many ways can you buy 78 cookies?

<pre>
Just by trial and error you can easily get the answer

1. 2 boxes of 39, 
2. 1 box of 39 and 2 boxes of 13, and
3. 6 boxes of 13.

If you're supposed to use algebra or number theory, then

Let x = the number of packages of 13 cookies
Let y = the number of packages of 39 cookies.

That leads to the Diophantine equation:

13x + 39y = 78

Divide through by 13

x + 3y = 6

x = 6 - 3y

x &#8805; 0, y &#8805; 0

6 - 3y &#8805; 0

   -3y &#8805; -6
     
     y &#8804; 2

Also y &#8805; 0 so

0 &#8804; y &#8804; 2

Since y is an integer, y can only take on the values 0,1, and 2.

So the answer is 3.

They are 2 boxes of 39, 
1 box of 39 and 2 boxes of 13, and
6 boxes of 13. 

Edwin</pre>