Saturday, May 22, 2010

KAPREKAR'S SOLITAIRE

We have all heard of Srinivasa Ramanujam, the great Indian mathematician, but if I mention D R Kaprekar, you’ll ask me, Kaprekar who?

Dattaraya Ramchandra Kaprekar was a schoolteacher in Nashik (Maharashtra). This 1905-born received his secondary school education in Thane and studied at Fergusson College in Pune. In 1927, he won the Wrangler R. P. Paranjpe Mathematical Prize for an original piece of work in mathematics. He had no formal postgraduate training and working alone, discovered several interesting properties of numbers.

Initially, his ideas were not taken seriously by Indian mathematicians. International fame arrived late in 1975 when Martin Gardner wrote about Kaprekar in his column Mathematical Games for The Scientific American. Today his name is well-known and many other mathematicians have pursued the study of the properties he discovered.

Though he is credited with the discovery of Devlali Numbers, Harshad Numbers and Demlo Numbers, the most famous of his discoveries is the Kaprekar Constant.

Most numbers can be generated by adding another number and its digits. For instance, take 23. It is 16 + 1 + 6. Take 70. It is 62 + 6 + 2. Now try the same thing with 20. Now matter what you do, it is impossible to generate 20 in this manner. Thus 20 is a Devlali Number. The first 20 Devlali Numbers are 1, 3, 5, 7, 9, 20, 31, 42, 53, 64, 75, 86, 97, 108, 110, 121, 132, 143, 154, 165, 176, 187, 198, 209 and 211.

A Harshad number is one divisible by the sum of its digits. Take 23. As it is not divisible by 2 + 3 = 5, it is a non-Harshad Number. However, 70 is, as it can be divided by 7 + 0 = 7. The numbers 1 to 9 are all obviously Harshad Numbers. The next 25 Harshad numbers are 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100 and 102.

I found the Demlo Numbers too complicated for me but Kaprekar Constant, the jewel on the Kaprekar crown, is fascinating. It is a really mysterious number, though at first glance, it might not seem so obvious.

Take any four-digit number with at least one digit different from the rest.(That is, not 1111, 2222, ...). Write down the largest and the smallest numbers that can be formed from its digits. Subtract the smaller number from the larger to get a new number. Repeat the operation for the result obtained. If you carry one the process, you will find that it ends in a number that repeats itself. Let us call this repeating number the kernel of this operation for that number.

For instance, let's take 2010, the current year. The largest number we can make with these digits is 2100, and the smallest is 0012 or 12. The process is: 2100 – 12 = 2088 >> 8820 – 288 = 8532 >> 8532 – 2358 = 6174 >> 7641 – 1467 = 6174 >> 7641 – 1467 = 6174 >> … We find that the kernel of 2010 is 6174 and have reached the kernel in three steps.

Okay, you reach a kernel, so what?

Now take 2005. The operation yields 5200 – 0025 = 5175 >> 7551 – 1557 = 5994 >> 9954 – 4599 = 5355 >> 5553 – 3555 = 1998 >> 9981 – 1899 = 8082 >> 8820 – 0288 = 8532 >> 8532 – 2358 = 6174 >> 7641 – 1467 = 6174 >> 7641 – 1467 = 6174 >> …

This time it has taken a few more steps to reach the kernel from 2005, but are you surprised that the kernel is the same, namely 6174? Sheer coincidence, you and I would have thought.

Kaprekar thought differently. He discovered that this simple operation led to the surprising result that the kernel cannot but be 6174! Every four digit number where the digits aren't all equal reaches 6174 under Kaprekar's process. It's marvellous, isn't it? Kaprekar's operation is so simple but uncovers such an interesting result.

Is this as special as 6174 gets? Well, not only is 6174 the only kernel for the operation, it also has one more surprise up its sleeve.

Let's try again, starting with a different number, say 1789. Here we go: 9871 – 1789 = 8082 >> 8820 – 0288 = 8532 >> 8532 – 2358 = 6174.

When we started with 2010 and 1789, the process took us to 6174 in three steps, but 2005 took seven steps. In fact, you reach 6174 for all four-digit numbers that don't have all the digits the same and in at most seven steps.

For three-digit numbers, the same phenomenon occurs. Application of Kaprekar's operation to the three digit number 753 gives the following: 753 – 357 = 396 >> 963 – 369 = 594 >> 954 – 459 = 495 >> 954 – 459 = 495 >> 954 – 459 = 495 >> … The number 495 is the unique kernel for the operation on three digit numbers, and all three digit numbers reach 495 using the operation.

How about other numbers? Let try it out for a two digit number, say 28. We have 82 – 28 = 54 >> 54 – 45 = 9 >> 90 – 09 = 81 >> 81 – 18 = 63 >> 63 – 36 = 27 >> 72 – 27 = 45 >> 54 – 45 = 9 >> 90 – 09 = 81 >> 81 – 18 = 63 >> 63 – 36 = 27 >> 72 – 27 = 45 >> 54 – 45 = 9 >> … It doesn't take long to check that all two digit numbers will reach the loop 9 → 81 → 63 → 27 → 45 → 9. Not quite as impressive as three and four digit numbers, which have unique kernels.

There is no kernel for Kaprekar's operation on five digit numbers. But all five digit numbers do reach one of the following three loops:

71973 → 83952 → 74943 → 62964 → 71973
75933 → 63954 → 61974 → 82962 → 75933
59994 → 53955 → 59994

It will certainly take a lot of time to check what happens for six or more digits, and this work becomes extremely dull! I’d rather play Solitaire than meddle with numbers like Kaprekar did!

3 comments:

Santanu Sinha Chaudhuri said...

Most interesting! 6174 thanks for the piece.

wannabe said...

Thanks.

My wife had castigated me for imposing my fads on the few unsuspecting readers I have (whose number, I guess is a one-digit number - not in binary, but the usual base 10, I assure you!), but I seem to be getting compliments for the most unlikely pieces from the most unlikely persons!

A friend who would rather be seen in the company of Shibu Soren than a book of Mathematics called to say how fascinated he was! My day has been made!

Varsha said...

wow wow wow!!!

Maths is my favorite enemy. The friend I never had. From childhood. So even I would choose solitaire over numbers like you, unlike Kaprekar!! But glad Kaprekar didn't think so....else would have deprived of the "magic" of numbers....