Let n≥2 be such an integer. Because n=a1+a2+⋯, there exists a positive integer k>0 such that ak=0 and ai=0 for all integers i>k.
Because n10k=a1a2⋯ak is an integer and n10k−1=a1a2⋯ak−1,ak is not an integer, there exist two non-negative integers a,b≥0 such that n=2a⋅5b, with max{a,b}=k. We have three cases:
a. If k=a=b, then n=10k≥10 and a1+a2+⋯+ak=1=n, contradiction.
b. If k=b>a, then
5k≤2a⋅5k=n=a1+a2+⋯+ak≤9k.
For k=2, we have 52=25>18=9×2. If k≥2 and 5k>9k, then 5k+1>5×9k=9(k+4k)>9(k+1). This implies that k=1 and therefore a=0, that is n=5. But n1=0.2 and n=2, contradiction.
c. If k=a>b, then
2k≤2k⋅5b=n=a1+a2+⋯+ak≤9k.
For k=6, we have 26=64>54=9×6. If k≥6 and 2k>9k, then 2k+1=2k+2k>9k+26>9(k+1). This implies that k≤5.
Now, assume that b≥1. We have
10×2k−1≤n=a1+a2+⋯+ak≤9k.
For k=1, this is not satisfied. Assume that 10×2k−1>9k. We have 10×2k>9k+10×2k−1≥9k+10>9(k+1), contradiction.
Hence, b=0 and n=2k.
By checking for k=1,2,3,4,5 we find that only n=23 has this property.
Hence n=8.