×

# Kaprekar's Constant

Take any four digit number (whose digits are not all identical), and do the following:

Rearrange the string of digits to form the largest and smallest 4-digit numbers possible. Take these two numbers and subtract the smaller number from the larger. Use the number you obtain and repeat the above process. What happens if you repeat the above process over and over? Let's see...
Suppose we choose the number 3141.
4311-1134=3177.
7731-1377=6354.
6543-3456=3087.
8730-0378=8352.
8532-2358=6174.
7641-1467=6174...
The process eventually hits 6174 and then stays there!

But the more amazing thing is this: every four digit number whose digits are not all the same will eventually hit 6174, in at most 7 steps, and then stay there!

Presentation Suggestions:
Remember that if you encounter any numbers with fewer than has fewer 4 digits, it must be treated as though it had 4 digits, using leading zeroes. Example: if you start with 3222 and subtract 2333, then the difference is 0999. The next step would then consider the difference 9990-0999=8991, and so on. You might ask students to investigate what happens for strings of other lengths or in other bases.

The Math Behind the Fact: Each number in the sequence uniquely determines the next number in the sequence. Since there are only finitely many possibilities, eventually the sequence must return to a number it hit before, leading to a cycle. So any starting number will give a sequence that eventually cycles. There can be many cycles; however, for length 4 strings in base 10, there happens to be 1 non-trivial cycle, and it has length 1 (involving the number 6174).

Note by Nurul Ikram
9 months, 3 weeks ago

Sort by:

I think your statement needs better clarity. It is not enough that all digits are not identical

For example

• $$9998-8999=999$$
• $$3332-2333=999$$
· 9 months, 3 weeks ago

Can you make the correct statement ? · 9 months, 3 weeks ago

read my note on karpekar's contant · 9 months, 3 weeks ago

I am sorry I did not get your point. Could you please tell me if there is anything wrong in the way in which I understood the theorem above? In the numbers I gave all digits are not the same. There are three nines and one eight in the first case. And the substraction would give the answer 999. And that would hit a zero in the next iteration. · 9 months, 3 weeks ago

You should add a zero before 999 as stated in the note. Then continue your iterations! · 9 months, 2 weeks ago

correct akhash raja raam · 9 months, 2 weeks ago

Can you find an expression which will tell you the number of steps?

(Even I don't know the answer. Just checking if you do.) · 9 months, 3 weeks ago