Saturday, November 12, 2011

Kaprekar's Constant (6174) in GeoGebra

While doing a little browsing, I came across Kaprekar's Constant. I remember reading about it a few years ago but I never did anything with it. I finally decided to play with it a little using GeoGebra. Here's a description from Wikipedia:
6174 is known as Kaprekar's constant after the Indian mathematician D. R. Kaprekar. This number is notable for the following property:
  1. Take any four-digit number, using at least two different digits. (Leading zeros are allowed.)
  2. Arrange the digits in ascending and then in descending 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.
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:
  1. 5432 – 2345 = 3087
  2. 8730 – 0378 = 8352
  3. 8532 – 2358 = 6174
The only four-digit numbers for which Kaprekar's routine does not reach 6174 are repdigits such as 1111, which give the result 0 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:
Here's a screenshot of the GeoGebra applet:
If you'd like a copy just click on "File" then "Save As" and save a copy on your computer. Click on the "Play" button on the bottom left of the applet to begin the animation.

This is a Java Applet created using GeoGebra from - it looks like you don't have Java installed, please go to

No comments:

Post a Comment