Global AI and Data Science

Global AI & Data Science

Train, tune and distribute models with generative AI and machine learning capabilities

 View Only

Kaprekar Constant

By Moloy De posted Thu December 10, 2020 10:04 PM

  

6174 is known as Kaprekar's constant after the Indian mathematician D. R. Kaprekar. This number is notable for the following rule:

  1. Take any four-digit number, using at least two different digits (leading zeros are allowed).
  2. Arrange the digits in descending and then in ascending order to get two four-digit numbers, adding leading zeros if necessary.
  3. Subtract the smaller number from the bigger number.
  4. Go back to step 2 and repeat.

The above process, known as Kaprekar's routine, will always reach its fixed point, 6174, in at most 7 iterations. Once 6174 is reached, the process will continue yielding 7641 – 1467 = 6174. For example, choose 3524:

5432 – 2345 = 3087

8730 – 0378 = 8352

8532 – 2358 = 6174

7641 – 1467 = 6174

The only four-digit numbers for which Kaprekar's routine does not reach 6174 are repdigits such as 1111, which give the result 0000 after a single iteration. All other four-digit numbers eventually reach 6174 if leading zeros are used to keep the number of digits at 4.

Below is a histogram of time to stop for Kaprekar's routine. It’s interesting to note that most of the numbers stop in three steps or seven steps.



QUESTION I: What happens in the case of five- or six-digit numbers?

QUESTION II: What is a Demlo number?




#Featured-area-3
#Featured-area-3-home
#GlobalAIandDataScience
#GlobalDataScience
0 comments
7 views

Permalink