A382461 a(n) is the smallest number whose sum of digits is 2^n.
1, 2, 4, 8, 79, 5999, 19999999, 299999999999999, 49999999999999999999999999999, 899999999999999999999999999999999999999999999999999999999, 799999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
Offset: 0
Programs
-
Mathematica
a[n_]:=10^(Floor[2^n/9])(1+2^n-9Floor[2^n/9])-1; Array[a,11,0]
-
Python
def A382461(n): return (lambda x:(x[1]+1)*10**x[0]-1)(divmod(1<
Chai Wah Wu, Mar 29 2025
Formula
a(n) = 10^(floor(2^n/9))*(1 + 2^n - 9*floor(2^n/9)) - 1.
a(n) = A051885(2^n).