This hole is experimental, no solutions will be saved. Please leave feedback on the GitHub issue.

Kaprekar Numbers

Details

Any positive integer is a Kaprekar number on the following conditions: the integer is 1 or when splitting the integer's square in two makes their sum equal the original integer.

For example, the square of 55 equals 3,025. Splitting the square in 30 and 25 makes their sum equal 55. Both operands must retain their digit order but may differ in length.

Print all the Kaprekar numbers from 1 to 25,000,000 inclusive, each on their own line.

0 bytes, 0 chars
Restore solution
All
Compiled from AT&T syntax to x86-64 Linux. Use syscalls to write output.
Fennel is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
Uiua is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
ctrl + enter or

Delete Solution

Are you sure you want to delete your solution(s) for Kaprekar Numbers?

If you have separate bytes and chars solutions then both will be deleted.

This is irreversible, please backup any code you care about.

Type I understand and press confirm to continue.