Kaprekar Routine

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

Take a k-digit number, n, and rearrange its digits in descending order. Call this number B. Now arrange the digits in ascending order and call that number b. Compute and repeat the operation. This algorithm, known as the Kaprekar routine, always becomes cyclic. It was discovered in 1949 by D. R. Kaprekar for 4-digit numbers.

Contributed by: Rob Morris (March 2011)
Open content licensed under CC BY-NC-SA


Snapshots


Details

detailSectionParagraph


Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.
Send