courtesy ::: math point
Think of any 4 non-zero digits, where not all four digits are the same. Arrange the digits in descending order and ascending order and compute the difference. For instance, if the digits are 3,3,2 and 1,
3321-1233=2088
Repeat the above step by rearranging the result into ascending and descending order and compute the difference.
8820-0288=8532
Reiterating,
8532-2358=6174,
Strangely,
7641-1467=6174
The process terminates when the number reaches 6174. We can use another example,
9750-0579=9171
9711-1179=8532
8532-2358=6174
and Viola! We get the same result again! Can you figure out why this happens?