Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Kaprekar's routine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Iterative algorithm}} In [[number theory]], '''Kaprekar's routine''' is an [[iterative]] algorithm named after its inventor, Indian mathematician [[D. R. Kaprekar]].{{sfn|Kaprekar|1955}}{{sfn|Kaprekar|1980}} Each iteration starts with a four digit [[random number]], sorts the digits into descending and ascending order, and calculates the difference between the two new numbers. As an example, starting with the number 8991 in [[decimal|base 10]]: :{{math|1=9981 β 1899 = 8082}} :{{math|1=8820 β 0288 = 8532}} :{{math|1=8532 β 2358 = 6174}} :{{math|1=7641 β 1467 = 6174}} [[6174 (number)|6174]], known as '''Kaprekar's constant''', is a [[fixed point (mathematics)|fixed point]] of this algorithm. Any four-digit number (in base 10) with at least two distinct digits will reach 6174 within seven iterations.{{sfn|Hanover|2017|loc=Overview|p=1}} The algorithm runs on any [[natural number]] in any given [[number base]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)