History of Mathematics
in India IIT Gandhinagar, home

Project Brahmagupta · problem 5

Kaprekar Chains

In 1955, D. R. Kaprekar discovered that repeatedly applying the following process to any four-digit number (with at least two distinct digits) always leads to the fixed point 61746174:

  1. Start with a four-digit number nn in base 10 (with at least two distinct digits),
  2. Sort the digits into descending order to form α(n)\alpha(n), and into ascending order to form β(n)\beta(n).
  3. Compute K(n)=α(n)−β(n)K(n) = \alpha(n) - \beta(n), and repeat.

As an example, starting with the number 8991 in base 10:

9981−1899=80828820−288=85328532−2358=61747641−1467=6174\begin{aligned} 9981 - 1899 &= 8082 \\ 8820 - 288 &= 8532 \\ 8532 - 2358 &= 6174 \\ 7641 - 1467 &= 6174 \end{aligned}

We define the chain length ℓ(n)\ell(n) as the number of steps required to first reach 61746174. So ℓ(8991)=3\ell(8991) = 3. Find the sum of all valid four-digit integers nn (where 1000≤n≤99991000 \le n \le 9999) whose chain length is exactly 55.

Try it

Check an answer

Enter a number, or a decimal where the problem asks for one. Only a hash of the answer is kept on this page.

Problem 5 of Project Brahmagupta, published under the Creative Commons Attribution 4.0 licence. No solutions are published.