India to the World

Mathematics & Computer Science

Kaprekar's constant (6174)

1949D. R. KaprekarKaprekar's papersPan-Indian / unspecified

1949

Repeatedly subtracting a 4-digit number's ascending digits from its descending digits always reaches 6174.

Dated
1949
As scholars put it
1949
Originator
D. R. Kaprekar
Source text
Kaprekar's papers
Region
Pan-Indian / unspecified
Discipline
Mathematics & Computer Science
Evidence
Documented
Confidence
High
Verification
Reference-cited

Sort, flip, subtract, repeat

Take any four-digit number whose digits are not all the same. Arrange its digits from largest to smallest, then from smallest to largest, and subtract the second from the first. Do the same to the answer, and keep going 4. Starting from 2005 you get 5200 minus 0025, which is 5175, and after seven rounds you land on 6174. Starting from 1789 you need only three 4.

Once you reach 6174 you are stuck there for good, because 7641 minus 1467 is 6174 again 5. Yutaka Nishiyama checked all 8,991 eligible four-digit numbers by computer and found that every one reaches 6174 in at most seven steps 4. The only escape is a repdigit such as 3333, which drops straight to zero 5.

A schoolteacher in Devlali

Dattatreya Ramachandra Kaprekar was born in 1905 in Dahanu, on the coast north of Mumbai. His father, a clerk with an interest in astrology, gave him an early love of calculation 3. He studied at Fergusson College in Pune, won the R. P. Paranjpe prize for original student mathematics in 1927, graduated in 1929 and then taught school mathematics in Devlali until he retired in 1962 3.

He described his passion with a comparison of his own: "A drunkard wants to go on drinking wine to remain in that pleasurable state. The same is the case with me in so far as numbers are concerned" 3. Besides 6174 he gave his name to Kaprekar numbers (703 squared is 494209, and 494 plus 209 is 703), studied self-numbers that no smaller number generates, and named Demlo numbers after the railway station where the idea came to him in 1923 3. Much of it appeared in small journals or in pamphlets marked "privately printed, Devlali" 3.

From a Madras conference to Scientific American

MacTutor dates the discovery of the routine to 1946. Kaprekar presented it at the Madras mathematical conference in 1949 and published it in Scripta Mathematica in 1953 3. The 1949 date used here and in most popular accounts is that announcement 4.

Many Indian mathematicians of his day dismissed his work as trivial, and he was little known in his lifetime 3. That changed in March 1975, when Martin Gardner devoted his "Mathematical Games" column in Scientific American to Kaprekar and his numbers 3. The caveat stands: this is recreational number theory, the kind of result G. H. Hardy might have called dull, and it does not connect to deep structure the way a major theorem does 5.

Why 6174, and what happens with other lengths

Nishiyama's proof is short. If a number with digits a, b, c, d in descending order is to reproduce itself, the subtraction forces a set of simple equations on those digits, and the only solution is 7, 6, 4, 1 4. The first subtraction also collapses all 8,991 starting numbers into a few dozen cases, which is why the journey is so short 4.

Other lengths behave differently. Three-digit numbers all fall to 495 45. Two-digit numbers have no fixed point and instead circle through 9, 81, 63, 27, 45 4. Five-digit numbers end in one of three loops, and six-digit numbers have two fixed points, 549945 and 631764 4. Four digits in base ten happens to be the case where everything funnels to a single answer, which is what makes 6174 a favourite in classrooms.

Background

D. R. Kaprekar (1905-1986) was a schoolteacher in Devlali, near Nashik, with no postgraduate training, who spent his life exploring the properties of ordinary numbers. He found the 6174 routine in 1946, announced it at the Madras mathematical conference of 1949 and published it in Scripta Mathematica in 1953.

Significance

It shows that a simple digit-shuffling rule pulls every four-digit number (bar repdigits) to a single fixed point within seven steps, a striking example of convergence in a discrete dynamical system. Its fame, and the wider study of Kaprekar routines in other bases and lengths, came mostly after Martin Gardner wrote about Kaprekar in Scientific American in 1975.

Fair to say

Recreational number theory rather than a deep theorem.

Path to modern innovation

A celebrated recreational-maths result.

Transmission

Done in Devlali, India, by a schoolteacher.

References

  • 1Kaprekar (1949)

Further reading

  • 2Wikipedia: 6174
  • 3Dattatreya Ramachandra Kaprekar (biography) J. J. O'Connor and E. F. Robertson, MacTutor History of Mathematics, University of St Andrews. His life in Devlali, the 1946 discovery, the 1949 announcement and his other number families
  • 4Mysterious number 6174 Yutaka Nishiyama, Plus Magazine, University of Cambridge, 2006. Worked examples and a short proof of why 6174 is the only four-digit kernel
  • 5Kaprekar's Number 6174 Peter Lynch, ThatsMaths, 2018. Readable overview, with the three-digit constant 495 and two-digit cycles

Corrections and additional sources: edit IND-254 on GitHub.