<<

International Journal of Mathematical Archive-4(5), 2013, 52-58 Available online through www.ijma.info ISSN 2229 – 5046

KAPREKAR CONSTANT REVISITED

Tanvir Prince*

Assistant Professor of , Hostos Community College, City University Of New York

Office Address: 500 Grand Concourse, Bronx, NY 10451, Telephone: (718)-518-6828

(Received on: 07-04-13; Revised & Accepted on: 01-05-13)

ABSTRACT Given a n digits number where not all the digits are same, we arrange the digits in increasing order and let us denote this number by i(n). Similarly arrange the given n digits in decreasing order and let us denote this number by d(n). Define the Kaprekar function, k(n) by k(n)=d(n)−i(n). If this new number has less than n digits, we add necessary 0’s on the left of k(n) to make it a n digits number. Then we keep repeat this process, that is we consider the 2 3 sequence {k(n),k (n),k (n),…}

D.R Kaprekar considered the case for n=4 and showed that the above sequence eventually becomes a constant and that magical constant is 6174 no matter what the four digits number you have started with. In this paper we will investigate this sequence for n=3 and n=4. We will also summarize some known results for some other values of “n”.

INTRODUCTION Dattaraya Ramchandra Kaprekar was born in 17 January, 1905, in Maharashtra India. He was a school teacher in Maharastra and never received any formal training in post graduate studies. Nevertheless, he discovered many interesting properties of numbers and became quite famous in the field of recreational . Beside Kaprekar constant, he also invented (not to be confused with Kaprekar constant, see [2]), self number, and Harshad number. He also contributed to construct some new magic squares. To know more about the life of Kaprekar and his mathematical contribution, please see [7].

Although Kaprekar constant is very interesting, it is not as widely kown as it should be. One of my goal in this article is that we will not only re-investigate Kaprekar constant but make it more familiar to every one. We will start with the definition of Kaprekar function which can be applied to any whole number. Then we will restrict the domain of Kaprekar constant to the numbers of digits three and four. From this, we will construct Kaprekar series and investigate the end behavior. If you are interested to see the original paper of Kaprekar, which is published in Scripta mathematica in 1955, see [1].

KEPREKAR FUNCTION Given a k digit number, n, say n=a a a …a , we arrange the digits in decreasing order and denote this number by 1 2 3 k d(n). That is d(n)=b b b …b where b ≥b ≥b ≥…≥b and there is a bijection between the sets {a ,a ,a …a } and 1 2 3 k 1 2 3 k 1 2 3 k {b ,b ,b ,…b }. Similarly, we arrange the digits of n in increasing order and denote this number by i(n). That is 1 2 3 k i(n)=c c …c where c ≤c ≤…≤c and there is a bijection between the sets {a ,a ,a …a } and {c ,c ,c ,…c }. 1 2 k 1 2 k 1 2 3 k 1 2 3 k Then we define the Kaprekar function on n by k(n)=d(n)−i(n). We always demand that the resulting number, k(n), must also have k digits; if it fails to have k digits, we just add necessary number of 0’s on the left.

For example, if n=33520, then d(n)=53320 and i(n)=02335 and finally, k(n) = d(n)−i(n) = 53320−02335 = 50985. If n=111110 then k(n) = 111110−011111 = 099999. Note that in the second example, we need to add a 0 on the left to make it a six digit number since the original n is six digit. Note that when applying Kaprekar function, the order of the digit does not matter. So for example,

k(123)=k(213)=k(312)=k(132)=…

Corresponding author: Tanvir Prince* Assistant Professor of Mathematics, Hostos Community College, City University Of New York

International Journal of Mathematical Archive- 4(5), May – 2013 52 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

Kaprekar sequence:

Given a k digit number n, the Kaprekar sequence associated with n is the 2 3 sequence {n,k(n),k (n),k (n),…}

i i i−1 Here we define k (n) recursively as k (n)=k(k (n)) for i≥2. For example the Kaprekar sequence associated with n=12345 is

{12345,41976,82962,75933,63954,61974,82962,…}

In this example, the seventh number is 82962 which is the same as the third number. So the sequence will be a cyclic pattern of length four. Let us take another example of digit 4 say n=3444, then the kaprekar sequence associated to this n is

{3444,0999,8991,8082,8532,6174,6174,6174,…}

In this case the Kaprekar sequence stabilizes after the sixth term since k(6174)=7641−1467=6174. This number 6174 is known as the Kaprekar constant. We will investigate this number in great detail.

THE CASE OF THREE DIGIT NUMBER

Lemma 1 Kaprekar sequence of any three digit number, as long as all the digits are not same, will eventually stabilizes to the constant 495 Of course if all the digits are same then after the first term all the other terms of the Kaprekar sequence is 0 since k(aaa)=0.

Proof: Let n=abc. We may assume that a≥b≥c since Kaprekar function does not depend on the order of the digits. Now, a≠c since if a=c then a=b=c but we assume not all the digits are same. So from definition, d(n)=abc and i(n)=cba. Thus, k(n)=d(n)−i(n)=abc−cba. This subtraction is given in the table 1. We will exlain this subtraction for the reader. First of all, since a

{099,891,792,693,594,495,495,495,…} {198,792,693,594,495,495,495,…} {297,693,594,495,495,495,…} {396,594,495,495,495,…} {495,495,495,…}

And of course, k(495)=495. Notice that the last four sequence is the repetition of the first one so it is enough to construct the Keprekar sequence of 099 only. So we have proved that no matter what is the three digit number you have started with, as long as all the digits are not same, the Kaprekar sequence stabilizes to the constant 495. This number 495 is the Kaprekar constant of digit three. this proof also shows that we arrive at the number 495 after at most six application of Kaprekar function.

For a somewhat different proof see [5].

a b c c b a a-1-c 9 c+10-a

Table 1: This table shows the process of subtraction for k(abc)

© 2013, IJMA. All Rights Reserved 53 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

THE CASE OF FOUR DIGIT NUMBER Lemma 2 Kaprekar sequence of any four digit number, as long as all the digits are not same, will eventually stabilizes to the constant 6174. Note that 6174 is a fixed point for the Kaprekar function since k(6174)=7641−1467=6174. This number, 6174 is known as the Kaprekar constant of digit four.

Proof: There are 10000 four digit numbers out of which there are 10 numbers whose digits are all same (they are 0000,1111,2222, etc). With some reasoning, we will show that to prove this lemma it is enough to check only 49 numbers out of this 10000−10=9990 four digits numbers. This is only 0.4905% of the original amount.

Let us start with a four digit number say n=abcd. Without loss of generality, we may assume that a≥b≥c≥d since applying Kaprekar function the order of the digit does not matter. We must have a>d, otherwise all the digits will be same. Now we have two possibility: b>c or b=c. We will consider these two cases separately: Case b=c:

In this case, n=abbd. So k(n)=k(abbd)=abbd−dbba. This subtraction is shown on the table 2.

a b b d d b b a a-1-d 9 9 d+10-a

Table 2: This table shows the subtraction for k(abbd)

The reasoning behind this table 2 is very similar to the proof of three digit case. So we will omit the explanation and leave it to the readers. We notice two things from this table. First, after applying the Kaprekar function, the middle two digits are 9 and second, the sum of all the digits are 27 (since a−1−d+9+9+d+10−a=27). So we may assume that n=a99(9−a) where 0≤a≤9. So in this case we need to check only the following five numbers, 0999,1998,2997,3996 and 4995. Let us find the kaprekar sequence of these five numbers and this is shown in table 3.

Numbers kaprekar Sequence 0999 {0999,8991,8082,8532,6174,6174,…} 1998 {1998,8082,8532,6174,6174,…} 2997 {2997,7173,6354,3087,8352,6174,6174,…} 3996 {3996,6264,4176,6174,6174,…} 4995 {4995,5355,1998,8082,8532,6174,6174,…}

Table 3: Numbers and the associated Kaprekar sequence

And this finishes the case for b=c.

Case for b>c:

In this case, we have n=abcd where a≥b>c≥d. And k(n)=abcd−dcba. This subtraction is shown on table 4. Again the process is exactly similar to the case of three digits which is given before so we leave the explanation to the readers.

a b c d d c b a a-d b-1-c c+9-b d+10-a

Table 4: Kaprekar function applied in the case of b>c

After looking at the table 4, we observe that in this case, after applying the Kaprekar function, the sum of the digits is 18. So without loss of generality, we may assume that n=abc(18−a−b−c) where a≥b≥c and 9≤a+b+c≤18.

If a+b+c=9, then we get the 12 possibilities for n which is given in table 5. The list for a+b+c=10 through a+b+c=14 is given in the table from 6 through table 10. We only list those numbers which are not repeated before. We do not get any new numbers for a+b+c=15 through a+b+c=18.

© 2013, IJMA. All Rights Reserved 54 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

a b c 18-a-b-c=9 9 0 0 9 8 1 0 9 7 2 0 9 7 1 1 9 6 3 0 9 6 2 1 9 5 4 0 9 5 3 1 9 5 2 2 9 4 4 1 9 4 3 2 9 3 3 3 9

Table 5: The case of a+b+c=9

a b c 18-a-b-c=8 8 2 0 8 8 1 1 8 7 3 0 8 7 2 1 8 6 4 0 8 6 3 1 8 6 2 2 8 5 5 0 8 5 4 1 8 5 3 2 8 4 4 2 8 4 3 3 8

Table 6: The case of a+b+c=10 and only included those numbers which are not repeated before

a b c 18-a-b-c=7 7 4 0 7 7 3 1 7 7 2 2 7 6 5 0 7 6 4 1 7 6 3 2 7 5 5 1 7 5 4 2 7 5 3 3 7 4 4 3 7

Table 7: The case of a+b+c=11 and only included those numbers which are not repeated before

a b c 18-a-b-c=6 6 6 0 6 6 5 1 6 6 4 2 6 6 3 3 6 5 5 2 6 5 4 3 6 4 4 4 6

Table 8: The case of a+b+c=12 and only included those numbers which are not repeated before

a b c 18-a-b-c=5 5 5 3 5 5 4 4 5

Table 9: The case of a+b+c=13 and only included those numbers which are not repeated before © 2013, IJMA. All Rights Reserved 55 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

a b c 18-a-b-c=4 9 4 1 4 7 4 3 4

Table 10: The case of a+b+c=14 and only included those numbers which are not repeated before

For the cases, a+b+c=15,a+b+c=16,a+b+c=17 and a+b+c=18, we do not get any new numbers. All the numbers in these cases were previously repeated. If we count the numbers from the table 5 through table 10, we get 44. It is very quick to check the Kaprekar sequence associated with these 44 numbers. To ease your task further, there are free software available in the web, for example see [9] and [6]. Although, at first it might looks like 44 is a huge number to compute Kaprekar sequence, 44 is in fact a tiny fraction of 9990 which is the total number of four digit number with not all digits same. Actually, we are only checking less than 0.5%. A careful calculation also shows that we arrive at 6174 in at most seven steps, that is the Kaprekar sequence stabilizes to 6174 in at most seven steps. This finishes the proof.

Just for fun, let us consider two digit numbers.

THE CASE OF TWO DIGIT NUMBERS Without loss of generality, let us assume n=ab where a>b. Then k(n)=k(ab)=ab−ba and this subtraction is given in table 11. We notice that, the sum of the digit is 9. So we may assume n=a(9−a) where 0≤a≤9. So the possible value for n for which we need to check the Kaprekar sequence are 09,18,27,36 and 54. Calculating the Kaprekar sequence for 09 gives {09,81,63,27,45,09…}. We see that all the other four numbers are included in this sequence (remember the order of the digit does not matter). So in the case of two digit numbers, the Kaprekar function does not have a fixed point but have a cycle of length five.

a b b a a-1-b b+10-a

Table 11: Kaprekar function for two digit number

VARIATION AND FURTHER INVESTIGATION We can vary two possible independent variable, one is the number of digit and the other is the base of the number. In this article, the base is always fixed at 10 and the number of digit considered were 2,3 and 4. Of course, for a given base and a given digit, there is only a finitely many (although this numbers may be huge and it does increase very fast) numbers to consider. Since the domain of the Kaprekar function is finite, it either end up in a fixed point or create a cycle of some given length and we can only have finitely many fixed points and finitely many cycles. In fact if the base k is b and the number of digit is k, then we only need to consider b −b many numbers. As we can see this is a exponential function in the variable k which is quite trouble some even for a computer to handle. Some partial answer is available in the literature. For example, if we fixed the number of digits at 3 and vary the base, what happen to the Kaprekar sequence? This question is investigated in [3]. A nice software can be download from the internet at [9] where you can vary both the base and the number of digits. If the digits are too long, you need to make sure that you have enough memory in your computer. This can be a nice tool for further investigation. For interested readers, the behavior of Kaprekar sequence of numbers of digit more than four (with fixed base 10) is given in table 12.

Number of digits Behavior of Kaprekar sequence five No fixed point of Kaprekar function, instead has three cycles:

{74943,62964,71973,83952,74943,…}

{63954,61974,82962,75933,63954…}

{53955,59994,53955,…} . These have length 4,4 and 2 respectively. six There are two fixed points of Kaprekar function:631764 and 549945 and one cycle of length seven:

{851742,750843,840852,860832,

862632,642654,420876,851742…}

© 2013, IJMA. All Rights Reserved 56 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

seven No fixed point for Kaprekar function but only one cycle of length eight:

{8429652,7619733,8439552,7509843,

9529641,8719722,8649432,7519743,8429652…}

eight Two fixed points for Kaprekar function : 97508421 and 63317664 and two cycles of length three and seven respectively:

{86526432,64308654,83208762,86526432,…}

{86308632,86326632,64326654,43208766,

85317642,75308643,84308652,86308632…}

nine There are two fixed points of Kaprekar function: 864197532 and 554999445 and one cycle of length fourteen:

{865296432,763197633,844296552,762098733,

964395531,863098632,965296431,873197622,865395432,

753098643,954197541,883098612,976494321,

874197522,865296432…}

ten There are three fixed points of Kaprekar function: 9753086421,6333176664 and 9975084201 and five cycles:

{8655264432,6431088654,8732087622,8655264432,…}

{8653266432,6433086654,8332087662,8653266432,…}

{8765264322,6543086544,8321088762,8765264322,…}

{9775084221,9755084421,9751088421,9775084221,…}

{8633086632,8633266632,6433266654,4332087666,

8533176642,7533086643,8433086652,8633086632,…}

The first four cycles have length three and the last one has length seven

Table 12: Kaprekar sequence of digits more than four, with fixed base 10

CONCLUSION From my childhood, I always fascinate by numbers and I am sure this is true for mathematicians and non-mathematicians alike. In this article, I hope to prove this point. If reading this article, some readers at some part of the world pick up a book in number theory, I will consider myself a success.

REFERENCES [1] D.R.Kapekar. An interesting property of the number 6174. Scripta Mathematica, 15:244–245, 1955.

[2] D.R.Kaprekar. On kaprekar numbers. Journal Of , 13(2):81–82, 1980.

[3] Klaus E. Eldridge and Seok Sagong. The determination of kaprekar convergence and loop convergence of all three digits numbers. The American Mathematical Monthly, 95(2):105–112, 1988.

© 2013, IJMA. All Rights Reserved 57 Tanvir Prince*/Kaprekar Constant Revisited/ IJMA- 4(5), May-2013.

[4] Yutaka Nishiyama. Mysterious number 6174. http://plus.maths.org/issue38/features/nishiyama/index.html, 2000.

[5] Patrik Kumar Ray. On the number 495. Pi Mu Epsilon Journal, 11(6):241–242, 2002.

[6] World Wide Web. Kaprekar routine. http://labs.crowdway.com/kaprekar, 2000.

[7] World Wide Web. Life of kaprekar. http://en.wikipedia.org/wiki/Kaprekar, 2000.

[8] World Wide Web. The number 6174. http://en.wikipedia.org/wiki/6174, 2000.

[9] World Wide Web. Kaprekar series generator. http://kaprekar.sourceforge.net, 2003. Online program to download.

[10] World Wide Web. The mysterious 6174 revisited. http://mathpoint.blogspot.com/2006/12/mysterious, 2006.

Source of support: Nil, Conflict of interest: None Declared

© 2013, IJMA. All Rights Reserved 58