How to generate the magical Kaprekar’s number 6174

Are you aware of the fact that by taking any 4 digit number, & performing the following operations, the result converges to a constant magical number…



Yes that magical number is 6174,popularly known as the Kaprekar’s number, named after great former Indian scientist cum mathematician Mr. Kaprekar

1. Sort the digits of the number in descending order & store; lets say asc_sort
2. Sort the digits in ascending & store,; lets say desc_sort
3. Subtract the second series from the first; (desc_sort-asc_sort)
4. Repeat steps 1-3 for the resultant upto 10 iterations (max)

Ultimately the result will converge to a unique number 6174; the Kaprekar’s magical number, & after that doing infinite iterations further also yield the same result 6174!!

This holds true even for a 3-digit number & the series converges to 495; the 3 digit Kaprekar’s constant!!

Click here to see the C Code snippet to generate the 4 digit magical Kaprekar’s constant 6174



Related posts:

  1. C code snippet to generate Kaprekar’s magical constant 6174

Filed Under: Archive Categories

About the Author

Om is a dynamic entrepreneur, renowned author, and founder of Webfosys Networks Pvt Ltd that provides IT, content creation, SEO & Website Design services to several clients across the globe. He has written over 12,000 articles, and loves to write Tech Reviews and Auto Reviews Reach him 24/7 - om.thoke86@gmail.com

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.