On this page
Pick any four-digit number with at least two different digits. Arrange its digits from largest to smallest, then from smallest to largest, and subtract. Do the same with the answer, and keep going. Within a few steps you will land on 6174, and you will stay there. The man who found this was not a university professor but a schoolteacher in a small town in Maharashtra. This post works through his most famous result, shows why it happens with simple algebra, and covers his other number discoveries and what students can learn from his way of working.
Who was D. R. Kaprekar?
The MacTutor biography of D. R. Kaprekar records that he was born on 17 January 1905 in Dahanu, on the coast north of Mumbai. He went to secondary school in Thane, spent hours on mathematical puzzles, and began his studies at Fergusson College, Pune, in 1923. In 1927 he won the Wrangler R. P. Paranjpe Mathematical Prize for original mathematics by a student, and he graduated with a BSc in 1929.
That year he became a mathematics teacher at a school in Devlali, near Nashik, and he taught there for his whole career until retiring in 1962. MacTutor notes that many Indian mathematicians thought his ideas trivial, and that he published several of them himself as pamphlets printed in Devlali. He died in 1986.
How does the 6174 routine work?
MacTutor records that Kaprekar discovered the result in 1946, announced it at the Madras Mathematical Conference in 1949 and published it in 1953 as Problems involving reversal of digits in Scripta Mathematica.
Worked example 1: start with 3524.
5432 − 2345 = 3087
8730 − 0378 = 8352
8532 − 2358 = 6174
7641 − 1467 = 6174, and it repeats from here.
Worked example 2: start with 2111.
2111 − 1112 = 0999 (keep the zero, so it stays a four-digit number)
9990 − 0999 = 8991
9981 − 1899 = 8082
8820 − 0288 = 8532
8532 − 2358 = 6174
MacTutor states that the process reaches 6174 within at most seven steps. We checked every four-digit starting number with a short computer program, and the longest chain was indeed seven steps. The only starting numbers that fail are those with all four digits equal, such as 1111, which give 0 at once.
Why does it always reach 6174?
Write the digits in descending order as a ≥ b ≥ c ≥ d. The largest arrangement is 1000a + 100b + 10c + d and the smallest is 1000d + 100c + 10b + a. Subtract:
(1000a + 100b + 10c + d) − (1000d + 100c + 10b + a) = 999(a − d) + 90(b − c).
Two things follow. Every answer is a multiple of 9, because both 999 and 90 are. And every answer depends on only two numbers, a − d (from 1 to 9) and b − c (from 0 up to a − d). Counting the pairs, there are at most 54 possible results after the first step, however you start, so the routine quickly funnels into a single fixed point. That fixed point is 6174, since 7641 − 1467 = 6174 gives the same number back. Turning a pattern into a short proof like this is the kind of reasoning maths olympiads reward; our guide to IOQM preparation has more.
Common mistakes. Dropping the leading zero, so 0999 becomes 999 and the next step uses three digits; you then end at 495 instead of 6174. Subtracting the reverse of the original number rather than the smallest rearrangement of its digits. And starting with a number like 5555, which goes straight to zero.
What other numbers did he discover?
The On-Line Encyclopedia of Integer Sequences lists Kaprekar numbers: numbers whose square can be split into two parts that add back to the number. For example, 45² = 2025 and 20 + 25 = 45, while 297² = 88209 and 88 + 209 = 297. The list starts 1, 9, 45, 55, 99, 297, 703, 999.
He also defined self-numbers, which MacTutor says he called Swayambhu. Add a number to the sum of its digits: 15 gives 15 + 1 + 5 = 21. A self-number is one that no number generates this way. The OEIS list of self numbers begins 1, 3, 5, 7, 9, 20, 31, 42. You can check 20: no number from 1 to 19 plus its digit sum equals 20.
And he named Harshad numbers, from the Sanskrit for great joy: numbers divisible by the sum of their digits, such as 18, since 1 + 8 = 9 divides 18. They are listed in the OEIS as Niven or Harshad numbers.
International attention came late. MacTutor records that it arrived in 1975, when Martin Gardner wrote about Kaprekar's numbers in his Mathematical Games column in Scientific American.
What can a student take from how he worked?
Play with numbers. He found his results by calculating, by hand, far more examples than anyone else bothered to.
Then ask why. A pattern is a guess until you prove it. The two-line algebra above turns 6174 from a curiosity into a theorem.
Keep going without applause. Many mathematicians dismissed his ideas, so he published in small journals and printed pamphlets himself.
Teach and explore together. He spent his career as a school teacher and still did original mathematics.
For another Indian mathematician who found deep patterns in numbers, read our profile of Ramanujan and his notebooks. If you want to check your own number patterns step by step, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.
Your next step: run the routine on your own birth year and count how many steps it takes to reach 6174.



