The Kernels of Kaprekar
A Couple of Rather Mysterious Mathematical Anomalies

In the middle of the last century, a man named D. R. Kaprekar happened to stumble upon an interesting discovery while he was doing some recreational math. Now, although his findings don’t really seem to have any practical value they are still intriguing nonetheless, having a special value of their own (pun intended). You see, he devised a process now known as “Kaprekar’s Operation”. It’s really quite simple, and rather complex at the same time. To understand how this works, first choose a four-digit number where the digits are not all equal, meaning not 1111 or 2222, for instance. Since 2050 will be just over a century after Kaprekar’s discovery, and because it contains a couple of zeros, I’ll use that number to show you how this works. The next step is to rearrange those digits to get the largest and smallest numbers that they can be used to generate, which are of course 5200 and 25 (0025). Finally, subtract the smallest number from the largest to get a new number, and then carry on repeating the operation for each new number as follows:
5200–0025=5175
7551–1557=5994
9954–4599=5355
5553–3555=1998
9981–1899=8082
8820–0288=8532
8532–2358=6174
7641–1467=6174
This can be done with any four-digit number, but for the sake of ease let’s take a look at 2019, specifically. These are just the digits of the year, as of the time of this writing. As such, the maximum number we can make with these digits is 9210, and the minimum is 0129 or 129. The first number places the digits in order from largest to smallest, while the second number is the reverse order, being smallest to largest. This gives a minuend of 9210 and the subtrahend of 0129, which produces a difference of 9081. This then becomes the basis for the next arrangement, and so on and so forth:
9210–0129=9081
9810–0189=9621
9621–1269=8352
8532–2358=6174
7641–1467=6174
This process always results in the same iteration (7641–1467=6174). It’s a well-established fact that every four-digit number where the digits aren’t all equal will inevitably reach 6174 under Kaprekar’s process and in at most seven steps. Thus, the number 6174 is one of Kaprekar’s “kernels”. If you don’t believe me just try it out for yourself. You’ll see. This is the only number unchanged by the operation, so the mysterious number is rather unique. Plus, this also works with three-digit numbers as well. However, this is centered around a different kernel, namely number 495. To demonstrate this, let’s just use the first three digits of the other kernel (617):
761–167=594
954–459=495
954–459=495
Pick any three-digit number with separate digits, like 729 for instance. This would result in the following iteration:

Again, I know these numbers aren’t as amazing as something like pi (3.141…) or phi (1.618…), but nonetheless, the kernels do emerge out of mathematics, and the reasoning behind it all can be fun to explore. As part of this, it’s interesting to note that there isn’t just one single kernel for anything other than numbers with three or four digits. Two-digit or five-digit numbers simply won’t produce the same kind of anomalous result. Again, if you don’t believe me then just try it and see for yourself. However, the numbers don’t lie, and the math is quite tedious. So, I will also just tell you what the results are. One-digit numbers are obviously inapplicable based on the non-repeating digit rule, two-digit numbers have no kernel, three and four do, of course, five doesn’t, but six has two kernels (549945 and 631764), seven doesn’t have any, and eight and nine both have two kernels, as well. Then, ten-digit numbers have three kernels. So, the operation is pretty strange, to say the least. What’s more, this is all important because part of the glory of science is in finding what doesn’t work in addition to what does. You see, although five-digit numbers don’t have a kernel, there is a pattern that gets produced. All five-digit numbers will always reach one of the following three loops:
71973 → 83952 → 74943 → 62964 → 71973
75933 → 63954 → 61974 → 82962 → 75933
59994 → 53955 → 59994
Granted, this operation probably won’t ever help people invent anything new but it does show that intellectual exercises can produce surprising results that are their own kind of reward. The drive to know all that can be known is deeply ingrained in our souls and the kernels are a special little part of the epistemics of mathematics, which is contained in the bigger picture. This is part of the fundamental structure of logic, and it should all be working together to form the basis of your understanding of everything. Realizing how and why 495 and 6174 have this unique property is just another part of knowing how to know. So, ultimately this essay is simply another way for me to train your brain and teach you to tinker like any great thinker. After all, pattern recognition is something that everyone should be good at. Thanks for reading and have fun calculating!