login
A063554
Smallest k such that 2^k has exactly n 9's in its decimal representation.
8
1, 12, 34, 32, 83, 53, 92, 139, 93, 172, 173, 244, 254, 335, 342, 332, 333, 415, 356, 434, 506, 473, 477, 476, 517, 532, 596, 643, 662, 673, 731, 729, 603, 735, 850, 793, 792, 966, 959, 961, 1043, 1129, 1131, 1159, 1153, 1077, 1157, 1241, 1078, 1328
OFFSET
0,2
MATHEMATICA
a = {}; Do[k = 1; While[ Count[ IntegerDigits[2^k], 9] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
n9[n_]:=Module[{k=1}, While[DigitCount[2^k, 10, 9]!=n, k++]; k]; Array[n9, 50, 0] (* Harvey P. Dale, Dec 17 2011 *)
With[{t=DigitCount[#, 10, 9]&/@(2^Range[1500])}, Flatten[Table[Position[t, n, {1}, 1], {n, 0, 50}]]] (* Harvey P. Dale, Mar 17 2016 *)
PROG
(PARI) a(n)={my(k=1); while(n<>#select(d->d==9, digits(2^k)), k++); k} \\ Andrew Howroyd, Jun 26 2018
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Aug 10 2001
EXTENSIONS
Name corrected by Jon E. Schoenfield, Jun 25 2018
STATUS
approved