Once I walked up a hill, and on the summit sat a very old man cross-legged, calmly taking the air and observing the view below. I asked him if he was alone and he said:

"No. I have five cousins who are coming up after me. What is interesting about them superficially is that if you take their ages, each one being a double-digit integer, between them they include all of the digits 0 to 9.

But if you look deeper you will see it is even more remarkable: each pair of integers within the set is not coprime, that means they have a greatest common divisor that is 2 or more."

"Very interesting indeed" I replied. "But what can I ask is the closest gap between the ages of your cousins?"

"4 years" he replied.

How old are the five cousins?


1 Answer 1


The cousins are

34, 51, 68, 72, and 90.

Pairs are divisible by

2, 3, or 17.

I hunted for

Primes with multiples consisting of 3x is and some x is or , such that f(x)+4 was divisible by 3. This seemed the most likely approach to find a solution, as it would allow a variety of combinations to post-fit test for coprimality.

  • $\begingroup$ Did you also demonstrate that no other solutions are possible? (Wondering.) $\endgroup$
    – Wildcard
    Aug 15, 2017 at 1:10
  • 3
    $\begingroup$ By computer I checked that the solution is unique. There are many solutions with other minimum differences: $(diff,\#sol)\in\{(3,71),(4,1),(6,92),(7,2),(9,72),(12,57),(14,42),(15,9),(16,38),(18,16),(22,1)\}$. The unique solution with a difference of 22 is $\{10,32,54,76,98\}$. $\endgroup$ Aug 15, 2017 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.