6174


6174 is the natural number following 6173 and preceding 6175.

Kaprekar’s constant

The natural integer 6174 is known as Kaprekar’s constant, after the Indian mathematician D. R. Kaprekar. This number is notable for the following curious behavior:
  1. Select any four-digit number that has at least two different digits,
  2. Create two new four-digit numbers by arranging the original digits in ascending and descending order.
  3. Subtract the smaller number from the bigger number.
  4. If the result is not 6174, return to step 2 and repeat.
This process, known as Kaprekar's routine, is guaranteed to reach a fixed point at the value 6174 in no more than 7 iterations, at which point it will continue yielding that value.
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. For numbers with three identical digits and a fourth digit that is one higher or lower, it is essential to treat 3-digit numbers with a leading zero; for example: 2111 – 1112 = 0999; 9990 – 999 = 8991; 9981 – 1899 = 8082; 8820 – 288 = 8532; 8532 – 2358 = 6174.

Other “Kaprekar’s constants”

There can be analogous fixed points for digit lengths other than four; for instance, if we use 3-digit numbers, then most sequences will terminate in the value 495 in at most 6 iterations. Sometimes these numbers are called “Kaprekar constants”.

Applications

Convergence analysis

In numerical analysis, Kaprekar’s constant can be used to analyze the convergence of a variety of numerical methods. Numerical methods are used in engineering, various forms of calculus, coding, and many other mathematical and scientific fields.

Recursion theory

The properties of Kaprekar’s routine allow for the study of General [recursive function|recursive functions], ones which repeat previous values and generate sequences based on these values. Kaprekar’s routine is a recursive arithmetic sequence, so it helps study the properties of recursive functions.

Other properties

  • 6174 is a 7-smooth number, i.e. none of its prime factors is greater than 7.
  • 6174 can be written as the sum of the first three powers of 18:
  • * 18 + 18 + 18 = 5832 + 324 + 18 = 6174, and coincidentally, 6 + 1 + 7 + 4 = 18.
  • The sum of squares of the prime factors of 6174 is a square:
  • * 2 + 3 + 3 + 7 + 7 + 7 = 4 + 9 + 9 + 49 + 49 + 49 = 169 = 13