# Mysterious number $6174$

Kaprekar discovered the Kaprekar constant or $6174$ in $1949$. He showed that $6174$ is reached in the limit as one repeatedly subtracts the highest and lowest numbers that can be constructed from a set of four digits that are not all identical.

e.g. starting with $1234$, we have $4321 − 1234$ = $3087$, then $8730 − 0378$ = $8352$, and $8532 − 2358$ = $6174$.

But, Why we reach to $6174$ through this process ? I think, subtraction is always divisible by $3$....(not sure)

• What happens with numbers like $\,1792\,$? Here we get $$9721-1279=8442...$$and the end comes abruptly as I get a number with two equal digits!? – DonAntonio Aug 12 '12 at 7:00
• @DonAntonio: If you continue your example, you do eventually reach 6174. – Michael Joyce Aug 12 '12 at 7:05
• Sir, if we continue this process,then we will get 1782, which has no digits in common. – ram Aug 12 '12 at 7:06
• @ram: Have you studied the cases of 2 and 3 digits first? For 2 digits, one can get cyclic behavior without a fixed point. (E.g. $01 \rightarrow 09 \rightarrow 81 \rightarrow 63 \rightarrow 27 \rightarrow 45 \rightarrow 09 \rightarrow \dots$) – Michael Joyce Aug 12 '12 at 7:07
• @DonAntonio When the OP says "4 digits which are not all identical", I believe he/she means 4 digits which are not all the same digit. – Alex Becker Aug 12 '12 at 7:13

$6174$ is a fixed-point of this process, i.e. $7641 - 1467 = 6174$. It turns out that it is the only fixed point, and there are no nontrivial cycles.

The sum of digits of the difference could also be $27$, e.g. for $6555-5556$.

• Do you have a proof on hand for these assertions (uniqueness of fixed point, no cycles)? – pre-kidney Jan 30 '13 at 1:08
• I missed the link to oeis.org/A099009 posted above. However my questions still remain unanswered. Furthermore, there are non-trivial fixed points, just none of them are small enough to matter. – pre-kidney Jan 30 '13 at 1:29
• Did you look at the paper Kevin Carlson referred to, and the references therein? – Robert Israel Jan 30 '13 at 1:48
• There are only $9000$ four-digit decimal numbers. One way to prove the uniqueness of fixed point and absence of cycles is to check what happens to each of those numbers. – Robert Israel Jan 30 '13 at 1:51
• Thanks for the comments. I missed the link to the paper and I now I see that this is a well-studied problem. The uniqueness method you suggest is pretty brute-force; I suppose this indicates that this is a pretty "artificial" question, without interesting mathematical content behind it. – pre-kidney Jan 30 '13 at 1:54

After one subtraction you will have a number divisible by $9$ because the remainder on division by $9$ is not changed when you rearrange the digits. That is not a problem as $6174$ is divisible by $9$. The statement that we always reach $6174$ rests on (as best I know) a search of the possibilities. If you just look at multiples of $9$ there are only $1000$ to look at, which is not so many even by hand. You only have to look at one permutation of each set of digits, which reduces the search considerably. There may be other ways to limit the search.

When considering only 4 digit numbers, this problem can be expanded to any base and when you do that it can then be reduced to a system of 14 equations. 6174 is the only solution in base 10.

Other length 4 solutions are: $$0111_2, 1001_2,3021_4, \qquad 3032_5, 6174_{10}, 92b6_{15}, c3f8_{20},\dots$$