Two of the greatest mathematicians in history had names that began with the letters “Eu": Euclid and Euler. When I first started reading about mathematics, I often confused these two because their names are so similar. But there’s really no reason for confusion, of course, because they have nothing to do with each other.

Or do they?

Euclid was Greek and lived in Alexandria in the third century BC. He worked on number theory, logic and astronomy, and was particularly interested in geometry. His book Elements is perhaps the most influential mathematical text in history; generations of mathematicians used it to learn the subject, all the way till the early 20th century.

Leonhard Euler lived some 2,000 years after Euclid, in the 18th century. He was Swiss, but lived mostly in St Petersburg and Berlin. He is easily the most prolific mathematician the world has known. His writing about geometry, astronomy, music, topology, number theory and much more fill about 30,000 pages.

They lived two millennia apart, these two remarkable men. But it turns out they do have something in common, and therein lies something of a story about mathematics.

In the sixth century BC, Pythagoras and his mathematical followers studied what we now call “perfect" numbers, though more for their supposed mystical properties than anything else. Three centuries later, Euclid found them interesting as well, and mentions them several times in his Elements. He defined a perfect number as a positive integer whose factors add up to the number itself. Take 4, for example. Is 4 perfect? Its factors are 1 and 2 (because 1 x 4 = 4 and 2 x 2 = 4). But since 1 + 2 = 3, 4 is not a perfect number. Neither are 10 (factors 1, 2, 5) and 12 (1, 2, 3, 4, 6) and 42 (1, 2, 3, 6, 7, 14, 21).

But how about 6? Its factors are 1, 2 and 3—and 1 + 2 + 3 = 6. Thus 6 is perfect, and in fact it is the smallest perfect number. The next smallest is 28 (factors 1, 2, 4, 7, 14). At least one ancient philosopher, Philo of Alexandria, found cosmic significance in these two: Our planet was created in six days, he noted, and our moon takes 28 days to orbit the Earth. Sadly, he couldn’t attach similar import to the next two perfect numbers known to mathematics at the time, 496 (1, 2, 4, 8, 16, 31, 62, 124, 248) and 8128 (I leave you to list its factors).

It wasn’t till the 13th century that the next three perfect numbers were discovered (33,550,336; 8,589,869,056 and 137,438,691,328, but please don’t try listing their factors). As you can tell, perfects are rare indeed.

(See my column “Large, prime and beautiful")

With me so far? Now this procedure Euclid spelled out generates only even perfect numbers (maybe you can quickly tell why that’s so). But does every even perfect number have this form? Two thousand years after Euclid, Euler answered that with a “Yes"—and his proof is now called the “Euclid-Euler Theorem".

Think of it: Here is a theorem named for two mathematicians who lived two millennia apart. Something that is truly breathtaking. I would love to know if there is a discovery in biology or anthropology or economics, for example, named for scientists who worked on it though widely separated in time.

But there’s more. The mention above of even perfect numbers might make you ask, are there any odd perfects? Mathematicians have never found one, and so they suspect that there are none—though as always in mathematics, suspicion is nothing. Can we prove there are no odd perfects? Also, just as we know there is an infinite number of primes, are the perfects, though rare, also infinite?

These questions remain unanswered, even though there are mathematicians working on them today. Think of it again: Mathematicians have grappled with the intricacies of perfect numbers starting from at least the time of Pythagoras, all the way to modern times. That’s how hard the mathematics behind this simple idea really is.

The sense of wonder in that mental image of mathematicians plugging away over many centuries was best captured in a 2000 paper (Mathematics And Faith) by the late Princeton University mathematician Edward Nelson. “No other field of human endeavour so transcends the barriers of time and culture," he wrote. “What accounts for the astounding ability of Pythagoras, Euler, and mathematicians of the 21st century to engage in a common pursuit?"

Like I said: something of a story about mathematics.

Once a computer scientist, Dilip D’Souza now lives in Mumbai and writes for his dinners. A Matter of Numbers explores the joy of mathematics, with occasional forays into other

Comments are welcome at Read Dilip’s Mint columns at