Skip to content

mabubakarriaz/KaprekarConstant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

KaprekarConstant

Kaprekar constant, or 6174, is a constant that arises when we take a 4-digit integer, form the largest and smallest numbers from its digits, and then subtract these two numbers. Continuing with this process of forming and subtracting, we will always arrive at the number 6174

For instance: Take a 4-digit number like 3215. Rearranging to form the largest and smallest with these digits, we get 5321 and1235. Now, subtract them: 5321-1235 = 4086. Continue with the process of rearranging and subtracting:

Descending - Acending Answer
8640−0468 =8172
8721−1278 =7443
7443−3447 =3996
9963−3699 =6264
6642−2466 =4176
7641−1467 =6174

About

C# console app to check number of attempts a 4-digit takes to arrive at Kaprekar constant.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published