Python icon indicating copy to clipboard operation
Python copied to clipboard

Add Kaprekar's Constant (6174) Algorithm to Special Numbers

Open xingarr opened this issue 2 months ago • 0 comments

Description

This PR adds an implementation of Kaprekar's Constant (6174) algorithm to the maths/special_numbers directory.

What is Kaprekar's Constant?

Kaprekar's Constant is a fascinating mathematical property discovered by Indian mathematician D. R. Kaprekar in 1949. When you:

  1. Take any 4-digit number with at least two different digits
  2. Arrange digits in descending order (largest number)
  3. Arrange digits in ascending order (smallest number)
  4. Subtract smaller from larger
  5. Repeat with the result

xingarr avatar Nov 04 '25 12:11 xingarr