The Magic Number 6174 That Never Goes Away
Last night while checking out a YouTube video, the algorithm suggested a video about the 6174 magic number—also known as Kaprekar's constant. Since the word "magic" always catches my attention, I gave it a watch. And wow, this number really is magic! It’s so simple and fun that you can play around with it with your friends, kids, or anyone, really.
Let’s dive straight into the details.
What is the Magic of 6174?
The number 6174 is known as Kaprekar’s constant, and it has a special trick. If you take almost any 4-digit number, follow a few simple steps, and repeat them, you will always end up with 6174. No matter what!
Here’s how it works:
Pick a 4-digit number (it can’t have all the digits the same, like 1111 or 2222).
Rearrange the digits to make the biggest number possible and the smallest number possible.
Subtract the smallest number from the biggest number.
Repeat the process with the new number you get, and after a few rounds, you’ll reach 6174.
How to Do It (So Easy a 5-Year-Old Can Understand)
Let’s break it down super simply. Imagine you have a 4-digit number like 3524. Here’s what you do:
First, rearrange the digits so you get the largest and smallest numbers.
Largest: 5432
Smallest: 2345
Now subtract the smallest from the largest:
5432 - 2345 = 3087Now do the same thing with the new number, 3087.
Largest: 8730
Smallest: 0378 (which is just 378)
Subtract them:
8730 - 378 = 8352Now take 8352 and repeat the process:
Largest: 8532
Smallest: 2358
Subtract:
8532 - 2358 = 6174
And that’s it! You’ve reached the magic number 6174. If you keep going, you’ll always get 6174 no matter how many times you repeat the steps.
Try it out for yourself, you can check out this CodePen and play around with Kaprekar's constant right in your browser.
Who Discovered This and Why Is It Special?
The magic of 6174 was discovered by an Indian mathematician named D. R. Kaprekar in 1949. He loved finding interesting patterns in numbers, and this one is his most famous discovery. It’s a fun trick that shows how math can surprise us in unexpected ways.
India has contributed a lot to mathematics, from the invention of the number zero to the brilliant work of mathematicians like Srinivasa Ramanujan. Kaprekar’s constant is another reminder that math can be playful and full of cool discoveries, even when it seems simple.
Subscribe to my newsletter
Read articles from Priyank Patel directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Priyank Patel
Priyank Patel
A developer who writes somethings useful.