Question 467162
<pre>
Let N be the number of marbles.
N is a multiple of 3, say 3p
N is also 2 more than a multiple of 5, say 5q + 2

So

N = 3p = 5q + 2

Take the equation:

3p = 5q + 2

3 is the smallest coefficient in absolute value,
so write all the numbers in terms of their
nearest multiple of 3.  5 is nearest to 6, so we
write 5 as 6-1. 2 is nearest to 3 so we write 2 as
3-1 

3p = (6-1)q + (3-1)

3p = 6q - q + 3 - 1

Divide through by 3

p = 2q - q/3 + 1 - 1/3

Isolate the fractions

q/3 + 1/3 = 2q + 1 - p

The right side is an integer,
the left side is positive, so
both sides equal to some positive
integer, say A

A = q/3 + 1/3  and A = 2q + 1 - p
 
Clear of fractions:

3A = q + 1

q = 3A - 1

Substitute in A = 2q + 1 - p

A = 2(3A - 1) + 1 - p
A = 6A - 2 + 1 - p

p = 5A - 1

Substitute p = 5A - 1 and q = 3A - 1 in

0 < N < 30, and since N = 3p

0 < 3p < 30 

0 < p < 10   

0 < 5A - 1 < 10

1 < 5A < 11

.2 < A < 2.2                           

and since A is an integer,

 1 &#8806; A &#8806; 2

So A is either 1 or 2

if A = 1

p = 5A - 1            
p = 5(1) - 1
p = 5 - 1
p = 4

q = 3A - 1
q = 3(1) - 1
q = 3 - 1
q = 2

N = 3p = 5q + 2
N = 3(4) = 5(2) + 2
N = 12 = 12

----------------

If A = 2

p = 5A - 1            
p = 5(2) - 1
p = 10 - 1
p = 9

q = 3A - 1
q = 3(2) - 1
q = 6 - 1
q = 5

N = 3p = 5q + 2
N = 3(9) = 5(5) + 2
N = 27 = 27

---------------------

So there are two solutions, 12 and 27.

Edwin</pre>