Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to understand the algorithm to find self-number.
But I don't know what does C, k, j, b is mean at this formula. What's that? How do I understand and what should I assign to solve them?

share|cite|improve this question
up vote 2 down vote accepted

The formula you refer to is a recurrence. It generates some (not all) self-numbers. The first formula works in base 10, while the second works in base 2. The third generalizes to any base.

$C_k$ refers to the $k^{th}$ generated self number ($C_1$ is the first, $C_2$ is the second, ..etc.). Let's use the first formula to generate some self-numbers:

$C_1 = 9$ (as written between brackets)

We get $C_2$ by replacing $k$ in the formula by 2. $C_2 = 8*10^{2-1} + C_{2-1} + 8 = 8*10 + C_1 + 8 = 8*10 + 9 + 8 = 97$ (by substituting $C_1 = 9$).

You continue in this way and you get infinitely many self-numbers (but not all). If you really insist on generating all self-numbers, you iterate over all natural numbers and apply the test on each, or you find a cleverer way of doing it..

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.