[Math] About Self Number, which is found by D. R. Kaprekar.

algorithmsnumber theorysequences-and-series

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?

Best Answer

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..

Related Question