Kaprekar's Constant
   HOME

TheInfoList



OR:

In
number theory Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
, Kaprekar's routine is an
iterative Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
algorithm named after its inventor, Indian mathematician D. R. Kaprekar. Each iteration starts with a four-digit
random number A random number is generated by a random (stochastic) process such as throwing dice. Individual numbers cannot be predicted, but the likely result of generating a large quantity of numbers can be predicted by specific mathematical series and st ...
, sorts the digits into descending and ascending order, and calculates the difference between the two new numbers. As an example, starting with the number 8991 in
base 10 The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of t ...
: : : : : 6174, known as Kaprekar's constant, is a fixed point of this algorithm. Any four-digit number (in base 10) with at least two distinct digits will reach 6174 within seven iterations. The algorithm runs on any
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
in any given
number base In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
.


Definition and properties

The algorithm is as follows: # Choose any four digit
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
n in a given
number base In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
b. This is the first number of the sequence. # Create a new number \alpha by
sorting Sorting refers to ordering data in an increasing or decreasing manner according to some linear relationship among the data items. # ordering: arranging items in a sequence ordered by some criterion; # categorizing: grouping items with similar p ...
the digits of n in descending order, and another number \beta by sorting the digits of n in ascending order. These numbers may have leading zeros, which can be ignored. Subtract \alpha -\beta to produce the next number of the sequence. # Repeat step 2. The sequence is called a Kaprekar sequence and the
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-orie ...
K_b(n) = \alpha - \beta is the Kaprekar mapping. Some numbers map to themselves; these are the fixed points of the Kaprekar mapping, and are called Kaprekar's constants.
Zero 0 (zero) is a number representing an empty quantity. Adding (or subtracting) 0 to any number leaves that number unchanged; in mathematical terminology, 0 is the additive identity of the integers, rational numbers, real numbers, and compl ...
is a Kaprekar's constant for all bases b, and so is called a trivial Kaprekar's constant. All other Kaprekar's constants are nontrivial Kaprekar's constants. For example, in base 10, starting with 3524, : K_(3524) = 5432 - 2345 = 3087 : K_(3087) = 8730 - 378 = 8352 : K_(8352) = 8532 - 2358 = 6174 : K_(6174) = 7641 - 1467 = 6174 with 6174 as a Kaprekar's constant. All Kaprekar sequences will either reach one of these fixed points or will result in a repeating cycle. Either way, the end result is reached in a fairly small number of steps (within seven iterations or steps). Note that the numbers \alpha and \beta have the same
digit sum In mathematics, the digit sum of a natural number in a given radix, number base is the sum of all its numerical digit, digits. For example, the digit sum of the decimal number 9045 would be 9 + 0 + 4 + 5 = 18. Definition Let n be a natural number. ...
and hence the same remainder modulo b - 1. Therefore, each number in a Kaprekar sequence of base b numbers (other than possibly the first) is a multiple of b - 1. When leading zeroes are retained, only
repdigit In recreational mathematics, a repdigit or sometimes monodigit is a natural number composed of repeated instances of the same digit in a positional number system (often implicitly decimal). The word is a portmanteau of "repeated" and "digit". Ex ...
s lead to the trivial Kaprekar's constant. In
base 4 Quaternary is a numeral system with four as its base. It uses the digits 0, 1, 2, and 3 to represent any real number. Conversion from binary is straightforward. Four is the largest number within the subitizing range and one of two numbers ...
, it can easily be shown that all numbers of the form 3021, 310221, 31102221, 3...111...02...222...1 (where the length of the "1" sequence and the length of the "2" sequence are the same) are fixed points of the Kaprekar mapping. In base 10, it can easily be shown that all numbers of the form 6174, 631764, 63317664, 6...333...17...666...4 (where the length of the "3" sequence and the length of the "6" sequence are the same) are fixed points of the Kaprekar mapping.


Determination of Kaprekar numbers

In the following, "Kaprekar's constant " refers to a number that become positive fixed point as result of the Kaprekar's routine. In 1981, G. D. Prichett, et al. showed that the Kaprekar's constants are limited to two numbers, 495 (3 digits) and 6174 (4 digits). They also classified the Kaprekar numbers into four types, but there was some overlap in the classification. In 2005, Y. Hirata calculated all fixed points up to 31
decimal The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
digits and examined their distribution. In 2024, Haruo Iwasaki of the Ranzan Mathematics Study Group (headed by Kenichi Iyanaga) showed that in order for a natural number to be a Kaprekar number, it must belong to one of five mutually disjoint sets composed of combinations of the seven numbers 495, 6174, 36, 123456789, 27, 124578 and 09. Iwasaki also showed that this new classification using the five sets includes a corrected classification by Prichett, et al. As a result, if is considered as a constant, then the number of decimal -digit Kaprekar numbers is determined by two types of equations: : (1)  n=3x \quad\quad (x\geq1)\,,  ......... For the sequence of 3-digit constants 495 : (2)  n=4+2x \quad (x\geq0)\,,  ...... Sequence of 4-digit constant 6174 followed by 2-digit constants 36 or by three types of Diophantine equations: : (3)  n=9x+2y \quad (x\geq1,\ y\geq0)\,,  ......... Sequence of 123456789's and 36's : (4)  n=9x+14y \quad (x\geq1,\ y\geq1)\,,  ...... Sequence of 123456789's and (36 495495 272727)s : (5)  n=6x+2y+9z+2u \quad (x\geq1,\ y\geq1,\ z\geq0,\ u\geq0)\,.  ... Sequence of 124578's, 09's, 123456789's and 36's It was found that the number of integer solutions (sets of ) of the equations that can be established is the same as the number of solutions that express all of the -digit Kaprekar numbers. The above equations confirm that there are no other Kaprekar's constants than 495 and 6174. There are no Kaprekar numbers for 1, 2, 5, or 7 digits, since they do not satisfy any of equations (1)~(5). For six-digit numbers, there are two solutions that satisfy equations (1) and (2). Furthermore, it is clear that even-digits with greater than or equal to 8, and with 9 digits, or odd-digits with greater than or equal to 15 digits have multiple solutions. Although 11-digit and 13-digit numbers have only one solution, it forms a loop of five numbers and a loop of two numbers, respectively. Hence, Prichett's result that the Kaprekar's constants are limited to 495 (3 digits) and 6174 (4 digits)For three digits, we get 495 from the solution of (1) with =1. And for four digits, we get 6174 from the solution of (2) with =0. is verified. Therefore, the problem of determining all of the Kaprekar's constants and the number of these was solved. An example below will explain the Iwasaki's result. Example: In the case where decimal digits , since is an odd number and is not a multiple of 3, the equations (1) and (2) do not hold, and the only equations that can hold are (3), (4) and (5). And if the operation (denoted by ) defined above is applied once to the numbers corresponding to the solutions of these equations, seven Kaprekar numbers can be obtained. (3) The solution to is : :  ...... Sequence of a 123456789 followed by seven 36's :: . (4) The solution to is : :  ...... Sequence of 123456789 followed by 36 495495 272727 :: . (5) The solutions to are : :  ...... Sequence of 124578, four 09's and 123456789 :: , : :  ...... Sequence of 124578, three 09's, 123456789 and 36 :: , : :  ...... Sequence of 124578, two 09's, 123456789 and two 36's :: , : :  ...... Sequence of 124578, 09, 123456789 and three 36's :: , and : :  ...... Sequence of two 124578's, 09 and 123456789 :: .


Families of Kaprekar's constants


In case where even base (''b'' = 2''k'')

It can be shown that all natural numbers :m = (k) b^ \left(\sum_^ b^i\right) + (k - 1) b^ + (2k - 1) b^ \left(\sum_^ b^i\right) + (k - 1) b \left(\sum_^ b^i\right) + (k) are fixed points of the Kaprekar mapping in even base for all natural numbers .


See also

*
Arithmetic dynamics Arithmetic dynamics is a field that amalgamates two areas of mathematics, dynamical systems and number theory. Part of the inspiration comes from complex dynamics, the study of the Iterated function, iteration of self-maps of the complex plane or o ...
*
Collatz conjecture The Collatz conjecture is one of the most famous List of unsolved problems in mathematics, unsolved problems in mathematics. The conjecture asks whether repeating two simple arithmetic operations will eventually transform every positive integer ...
*
Dudeney number In number theory, a Dudeney number in a given number base b is a natural number equal to the perfect cube of another natural number such that the digit sum of the first natural number is equal to the second. The name derives from Henry Dudeney, ...
*
Factorion In number theory, a factorion in a given number base b is a natural number that equals the sum of the factorials of its digits. The name factorion was coined by the author Clifford A. Pickover. Definition Let n be a natural number. For a base b ...
*
Happy number In number theory, a happy number is a number which eventually reaches 1 when the number is replaced by the sum of the square of each digit. For instance, 13 is a happy number because 1^2+3^2=10, and 1^2+0^2=1. On the other hand, 4 is not a happy ...
*
Kaprekar number In mathematics, a natural number in a given number base is a p-Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has p digits, that add up to the original number. For example, in ...
*
Meertens number In number theory and mathematical logic, a Meertens number in a given number base b is a natural number that is its own Gödel number. It was named after Lambert Meertens by Richard S. Bird as a present during the celebration of his 25 years at ...
*
Narcissistic number In number theory, a narcissistic number 1 F_ : \mathbb \rightarrow \mathbb to be the following: : F_(n) = \sum_^ d_i^k. where k = \lfloor \log_ \rfloor + 1 is the number of digits in the number in base b, and : d_i = \frac is the value of each d ...
*
Perfect digit-to-digit invariant In number theory, a perfect digit-to-digit invariant (PDDI; also known as a Munchausen number) is a natural number in a given number base b that is equal to the sum of its digits each raised to the power of itself. An example in base 10 is 3435, b ...
*
Perfect digital invariant In number theory, a perfect digital invariant (PDI) is a number in a given number base (b) that is the sum of its own digits each raised to a given power (p). 0 F_ : \mathbb \rightarrow \mathbb is defined as: :F_(n) = \sum_^ d_i^p. where k = \lfl ...
*
Sum-product number A sum-product number in a given number base b is a natural number that is equal to the product of the sum of its digits and the product of its digits. There are a finite number of sum-product numbers in any given base b. In base 10, there are ...


Citations


References

* * * * * *


External links

*
Working link to YouTube

Sample (Perl) code to walk any four-digit number to Kaprekar's Constant

Sample (Python) code to walk any four-digit number to Kaprekar's Constant
{{Classes of natural numbers Arithmetic dynamics Base-dependent integer sequences Sorting algorithms