Self Number Calculator

Check whether a number can be written as another integer plus the sum of that integer's digits.

Math and PercentUpdated 2026-11-182 min read
Self Number Calculator
A whole number from 1 to 1,000,000.
Classification
...
Generating value m...
Digit sum of m...

What it does

A self number is a positive integer that cannot be written as m plus the sum of the decimal digits of m for any positive integer m. The name Colombian number is also used. The sequence begins 1, 3, 5, 7, 9, 20, 31 and 42.

The operation m plus its digit sum is sometimes called the generator function. Numbers that it never produces are precisely the self numbers. The gaps between them vary, and there is no simple closed form for the sequence.

Because the digit sum of m is small compared with m, any generator of n must lie just below n. This page searches that short interval, so the test is exact for every allowed input rather than an estimate.

The output shows the verdict and, when a generator exists, the value of m together with its digit sum. That makes it easy to confirm the relation by hand.

The input limit is one million. At that size the digit sum is at most about fifty four, which is well inside the search window used by the engine.

How to use

  1. Enter a whole number n from 1 to 1,000,000.
  2. Read the classification in the main result box.
  3. If a generator exists, read its value beside the verdict.
  4. Check the digit sum of that generator to confirm m plus its digits equals n.
  5. The default n = 20 reproduces the worked example.
  6. Try n = 21 to see a number with a generator.

Formula

n is a self number when there is no positive m with m + S(m) = n, where S(m) is the sum of the decimal digits of m
n
The integer being tested.
m
A candidate generator less than n.
S(m)
The sum of the decimal digits of m.

For inputs up to one million the digit sum is at most fifty four, so any generator must lie within that many steps below n. The engine searches that exact window, which makes the verdict reliable without scanning all smaller integers.

Worked example

Example: n = 20

The page opens with n = 20.

  1. Search values m just below 20.
  2. Try m = 15: its digit sum is 1 + 5 = 6, and 15 + 6 = 21, not 20.
  3. Try smaller values and none give 20.
  4. The tool reports Self number with no generator.
  5. For n = 21 the generator is 15, since 15 + 6 = 21.
  6. The tool reports Generated number, generator 15 and digit sum 6.

Reference table

Small self numbers and generated numbers
nGeneratorDigit sumSelf number
1n/an/aYes
3n/an/aYes
9n/an/aYes
1055No
20n/an/aYes
21156No

Limits

  • Inputs above 1,000,000 are rejected to keep the search window valid.
  • Only base ten digit sums are used.
  • The tool reports the first generator found, not every generator.
  • The result is a classification, not the sequence of self numbers up to n.

Common mistakes

  • Using the digital root rather than the full digit sum of m.
  • Searching m values above n, which cannot work.
  • Assuming every odd number is a self number.
  • Forgetting that m must be positive.
  • Confusing this with the sieve of lucky numbers.

Try it yourself

Quick checks. Answers sit tucked under each question.

Is 20 a self number?

Yes. No positive m satisfies m plus its digit sum equal to 20.

Is 21 a self number?

No, because 15 plus its digit sum 6 equals 21.

Is 10 a self number?

No, because 5 plus 5 equals 10.

Questions

What is another name for self numbers?

They are also called Colombian numbers.

Why is the search window short?

The digit sum grows very slowly, so a generator must be close below n.

Are there infinitely many self numbers?

Yes, the sequence continues without end.

Does the base matter?

Yes, this page uses base ten.

Are results exact?

Yes, the search covers every possible generator in the valid range.

What input range is accepted?

Whole numbers from 1 through 1,000,000.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.