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:
Filed Under: Archive Categories
