The Taxicab Number
The smallest number expressible as the sum of two cubes in two different ways. Ramanujan noticed it instantly - and it took seven steps to reach 6174.
→Think of any four-digit number. Your birth year. Your PIN. The last four digits of your phone number.
Now follow a very simple rule, over and over.
Within seven steps at most, you will land on the same number as everyone else who tries it:
6174.
And once you arrive, you can never leave.
Here is the whole rule. It takes one line:
Arrange the digits from largest to smallest, then from smallest to largest, and subtract.
Then do the same thing with the answer. And again.
Let's try it with 3524:
Three steps, and there it is. Now keep going, just to see what happens:
↳ it gives back itself. Forever.
6174 is a place you can arrive at, but never leave.
Two small rules
Your number needs at least two different digits - 1111 or 7777 will just give you zero. And keep any zeros as zeros: if you get 999, treat it as 0999.
For example, starting from 2111:
2111 − 1112 = 0999
9990 − 0999 = 8991
9981 − 1899 = 8082
8820 − 0288 = 8532
8532 − 2358 = 6174
D. R. Kaprekar, Devlali, India
The man who found this number was not a famous professor.
D. R. Kaprekar - Dattatreya Ramchandra Kaprekar - was a schoolteacher in Devlali, a small town near Nashik in western India. He studied at Fergusson College in Pune, then spent decades teaching at a local school.
He never earned an advanced degree in mathematics. He did not need one to fall in love with it.
Kaprekar played with numbers the way other people do crosswords - constantly, happily, and for their own sake. He once said that, like a drunkard who wants to keep drinking to stay in that pleasant state, he kept going with numbers for the joy of it.
Somewhere in all that play, he noticed something strange about four-digit numbers. He announced it at a mathematics conference in 1949, and published it a few years later.
He also named numbers for joy
Kaprekar gave the name Harshad numbers to numbers that can be divided evenly by the sum of their own digits - like 18, because 1 + 8 = 9, and 9 divides 18. "Harshad" comes from Sanskrit and means roughly joy-giver.
At first, many professional mathematicians in India shrugged.
To them, Kaprekar's discoveries looked like puzzles - "recreational" mathematics, fun but not serious. Kaprekar kept going anyway, publishing his findings in small journals and pamphlets.
Then, in 1975, the famous puzzle writer Martin Gardner described Kaprekar's work in his column in Scientific American, one of the most widely read science magazines in the world.
Suddenly, readers everywhere were scribbling four-digit numbers in the margins of their magazines - and watching them all fall into 6174.
The small-town schoolteacher's number had gone global.
It feels like magic. It is actually a funnel.
Here is the first clue: when you subtract a number from a rearrangement of its own digits, the answer is always a multiple of 9. So right away, huge numbers of possibilities disappear.
Here is the second: the answer only depends on how far apart the digits are - not on the digits themselves. That means very different starting numbers give exactly the same result.
There are 9,990 possible starting numbers. After just one step, they have collapsed into only 54 different numbers. After another step, even fewer. And after a few more, only one is left standing.
So why 6174 in particular?
Because it is the only four-digit number that turns back into itself:
7641 − 1467 = 6174
Every other number moves on. 6174 is the only one that stays still - so it is where everything eventually settles, like water running downhill into the one lake at the bottom of the valley.
Try as many four-digit numbers as you like. You will never need more than seven steps.
Here is how all 9,990 possible starting numbers behave:
Some familiar faces from this museum make the journey too. 5050 gets there in five steps. And 1729 - Ramanujan's famous taxi number - takes the longest possible route, all seven:
1729's seven-stop journey
1729 → 8442
8442 → 5994
5994 → 5355
5355 → 1998
1998 → 8082
8082 → 8532
8532 → 6174
↳ even the most famous number in mathematics cannot escape.
Is there something special about four digits?
Try the same rule with three-digit numbers, and everything falls into a different trap: 495. (954 − 459 = 495. It turns into itself, just like 6174.)
With two digits, there is no single resting place. Instead, the numbers go round and round in a loop: 09 → 81 → 63 → 27 → 45 → 09…
With five digits, the numbers fall into loops too. With six digits, there is more than one place to land.
Only the three- and four-digit worlds each have one single destination that every number is drawn toward.
That is part of what makes 6174 feel so uncanny: with four digits, the numbers could have wandered anywhere. Instead, they all go home to the same address.
Mathematicians have a word for a place that everything is drawn toward: an attractor.
Attractors are everywhere once you start looking.
A marble in a bowl always rolls to the bottom.
A swinging pendulum eventually hangs still.
Water finds the lowest point in a valley.
In each case, it does not matter where you start. The rules of the system pull everything toward the same place.
6174 is an attractor made of nothing but digits and subtraction.
That is the real surprise of Kaprekar's discovery. You do not need gravity, or water, or physics to get this kind of behaviour. A simple rule, repeated, is enough.
Kaprekar died in 1986. His name lives on in the constant, and in a whole family of number ideas that bear his name.
6174 has become one of the best-loved numbers in recreational mathematics - the kind of thing people show a friend on a napkin, or a teacher shows a class to make them gasp.
Partly because anyone can check it with a pencil.
Partly because it feels impossible until you see why.
And partly because of who found it: not a famous university professor, but a schoolteacher in a small Indian town who simply loved numbers, and kept playing with them long after others would have stopped.
Here is why 6174 matters:
Take almost any four-digit number (with at least two different digits).
Arrange its digits largest-to-smallest and smallest-to-largest, and subtract.
Repeat - and you will reach 6174 in at most seven steps.
Once there, it stays: 7641 − 1467 = 6174.
Discovered by D. R. Kaprekar, a schoolteacher from Devlali, India, and announced in 1949.
Became world-famous after Martin Gardner wrote about it in 1975.
It is an attractor: a single point that pulls every starting number toward it.
The whole story, in one panel.
Start anywhere you like.
6174 is a number you can escape from almost nowhere.
Collection
Mathematical Curiosities
Announced
1949, Pune
Published widely
1975, Scientific American
Entry added
2026
Powered by DollarPageClub