k-digit Kaprekar Routine

See The Kaprekar Routine at Wolfram MathWorld, and the 4-digit 6174 page.

Also see the 4-digit version of this page.

Enter a k-digit number.

num digits k:
input: