Kaprekar Number Calculator
Check whether a square can be split into two parts that add back to the original number.
What it does
A Kaprekar number is one whose square can be cut into two pieces that add up to the original number. For 45 the square is 2025, and splitting it as 20 and 25 gives 45. The property is named after the Indian mathematician D. R. Kaprekar.
The split is made by choosing a power of ten as the cut point. The right part is the remainder modulo that power, and the left part is the quotient. The test tries every possible cut point in the decimal expansion of the square.
This implementation requires both parts to be positive. That convention excludes trivial cases where the right part is zero and agrees with the standard small examples such as 9, 45 and 55. The special case of 1 is included by convention.
The page shows the square and the working split when one exists, so the verdict can be checked immediately. If no split works, the tool says so explicitly.
The input limit is one million, which keeps the square short and the search over cut points tiny.
How to use
- Enter a whole number n from 1 to 1,000,000.
- Read the classification in the main result box.
- Check the square of your number beside it.
- If the test passes, read the split that was found.
- The default n = 45 reproduces the worked example.
- Try n = 9 to see a two digit square with a valid split.
Formula
- n
- The integer being tested.
- 10^m
- The power of ten chosen as the split point.
- q, r
- The left and right parts of the square.
Every possible cut point from one digit up to one less than the length of the square is tried. The conditions q greater than zero and r greater than zero avoid degenerate splits. The case n equals one is accepted by convention, matching the standard sequence.
Worked example
Example: n = 45
The page opens with n = 45.
- Compute the square: 45 x 45 = 2025.
- Try a cut after two digits: left part 20 and right part 25.
- Add the parts: 20 + 25 = 45, which returns the original number.
- The tool reports square 2025, split 20 + 25, and Kaprekar number.
- For 9 the square is 81, and 8 + 1 = 9, so 9 also qualifies.
Reference table
| n | Square | Split | Kaprekar |
|---|---|---|---|
| 1 | 1 | 0 + 1 | Yes |
| 9 | 81 | 8 + 1 | Yes |
| 45 | 2025 | 20 + 25 | Yes |
| 55 | 3025 | 30 + 25 | Yes |
| 99 | 9801 | 98 + 1 | Yes |
| 24 | 576 | none | No |
Limits
- Inputs above 1,000,000 are rejected to keep the square readable.
- Both split parts must be positive in this implementation.
- The tool reports one working split, not every possible split.
- The related Kaprekar routine for digit rearrangement is a different idea.
Common mistakes
- Confusing this with the Kaprekar constant routine on four digits.
- Allowing the right part to be zero, which changes the sequence.
- Using only one fixed cut point instead of trying all of them.
- Assuming every square ending in a repeated digit qualifies.
- Rounding the square instead of computing it exactly.
Try it yourself
Quick checks. Answers sit tucked under each question.
Is 45 a Kaprekar number?
Yes, because 45 squared is 2025 and 20 + 25 = 45.
Is 9 a Kaprekar number?
Yes, because 81 splits as 8 + 1 = 9.
Is 24 a Kaprekar number?
No, because 576 has no cut point whose parts add back to 24.
Questions
Who was Kaprekar?
D. R. Kaprekar was an Indian mathematician who studied many properties of numbers.
Is this the same as the 6174 routine?
No. That routine rearranges digits, while this property splits a square.
Why must both parts be positive?
It is the standard convention that avoids trivial splits with a zero right part.
Is one included?
Yes, by the convention used in the standard sequence.
Are the squares exact?
Yes. Integer arithmetic is used.
What is the largest input?
One million.