 Diophantus of Alexandria first studied problems requiring integer solutions in the 3rd century CE.The Euclidean algorithm for greatest common divisor which underlies the solution of such problems was discovered by the Greek geometer Euclid and published in his "Elements" in 300CE.Singmaster traces a series of less plausibly related problems through the middle ages, with a few references as far back as the Babylonian empire circa 1700BC.