So I found this really cool math trick, but it doesn't work for 2244!

Here's the Math Trick: Take any four-digit number, using at least two different digits. Arrange the digits in ascending and then in descending order to get two four-digit numbers, adding leading zeros if necessary. Subtract the smaller number from the bigger number. Go back to step 2. After at most 7 iterations, you will end up with the number 6174, also known as Kaprekar’s Constant.

Here's an example where it works: starting with 2851 -> 8521 - 1258 = 7263.

(1) 7632 - 2367 = 5265

(2) 6552 - 2556 = 3996

(3) 9963 - 3699 = 6264

(4) 6642 - 2466 = 6264

(5) 6642 - 2466 = 4176

(6) 7641 - 1467 = 6147

And here it doesn't: starting with 2244 -> 4422 - 2244 = 2178.

(1) 8721 - 1278 = 7443

(2) 7443 - 3447 = 1996

(3) 9961 - 1699 = 8262

(4) 8622 - 2268 = 6354

(5) 6543 - 3456 = 3087

(6) 8730 - 0378 = 8472

(7) 8742 - 2478 = 6264

(8) 6642 - 2246 = 4396

It's been more than 7 iterations and still no sign of the constant! Is this math trick faulty, or am I doing some wrong?