 Some 
Diophantine equations have no solution, 
some have one or a finite number, and
others have infinitely many solutions.The monkey and the coconuts reduces 
algebraic- ally to a two variable linear Diophantine 
equation of the form
where d is the greatest common divisor 
of a and b.By Bézout's identity,
the equation is solvable if and only if d divides c. If it does, 
the equation has infinitely many periodic 
solutions of the form 
where (x0,y0) is a solution and t is a 
parameter than can be any integer.