A number n is a self number if there is no number g such that g + the sum of g's digits = n. So 18 is not a self number because 9+9=18, 43 is not a self number because 35+5+3=43.


The task is:

 Display the first 50 self numbers;
 I believe that the 100000000th self number is 1022727208. You should either confirm or dispute my conjecture.

224036583-1 is a Mersenne prime, claimed to also be a self number. Extra credit to anyone proving it.


See also
 
OEIS: A003052 - Self numbers or Colombian numbers
Wikipedia: Self numbers
 
sum[g_] := g + Total@IntegerDigits@g
 
ming[n_] := n - IntegerLength[n]*9
 
self[n_] := NoneTrue [Range[ming[n], n - 1], sum[#] == n &]
 
Module[{t = 1, x = 1},
 Reap[
   While[t <= 50,
    If[self[x], Sow[x]; t++]; x++]
   ][[2, 1]]]
 