Kaprekar's Iterations and Constants

In 1955, D. Kaprekar published a surprising result, concerning what is now known as Kaprekar's process. The process is iterative, such that the same procedure applies to the numbers obtained at each step. The surprise is what this process leads to. So, start with any 4-digit number. Then

  1. Arrange the digits of the number in the increasing and also in the decreasing order.

  2. Of the two numbers thus obtained, one is larger, the other smaller. Subtract the latter from the former.

  3. If the result is the same as the number in 1., stop. Otherwise, repeat 1-2 for the new number.

Two view points emerged since Kaprekar's publication. According to one, whenever the difference on step 2 has fewer than 4 digits, it is padded with zeros on the left to force a fixed number of digits on any step. The other approach is to let the intermediate numbers maintain their natural number of digits.

If all digits of the starting number are equal the very first step of the iterations produces 0. Excluding this case, the two approaches may lead to different results. Kaprekar's observation was that the first approach (the one with the fixed number of digits) always leads to the number 6174, which is a fixed point of the Kaprekar's process. Unless the numbers are padded when necessary, the process may occasionally lead to 0. This happens when all digits are equal, except for one, which is 1 larger or smaller than the rest, e.g., 1121 or 3444. Since, say,

2111 - 1112 = 999,

the very next step gives 0. To compare, if the number of digits is fixed, the above continues as

9990 - 999 = 8991,
9981 - 1899 = 8082,
8820 - 288 = 8532,
8532 - 2358 = 6174.


This applet requires Sun's Java VM 2 which your browser may perceive as a popup. Which it is not. If you want to see the applet work, visit Sun's website at http://www.java.com/en/download/index.jsp, download and install Java VM and enjoy the applet.


Buy this applet
What if applet does not run?

(Blue and thick black numbers are clickable.)

Nowadays number 6174 is known as Kaprekar's number or Kaprekar's constant.

The applet allows you to experiment with bases other than decimal and number of digits other than 4.

|Contact| |Front page| |Contents| |Algebra| |Store|

Copyright © 1996-2012 Alexander Bogomolny

 40619396

A math books store at a unique math study site. Shopping at the store helps maintain the site. Thank you.
Sites for teachers
Sites for parents
Terms of use
Awards
Interactive Activities

CTK Exchange
CTK Wiki Math
CTK Insights - a blog
Math Help
Games & Puzzles
What Is What
Arithmetic
Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Stories for Young
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Old and nice bookstore
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Sites for parents

Education & Parenting

Search:
Keywords:

Google
Web CTK
Supported by
3wVentures