|
|
A063586
|
|
Smallest k such that 5^k has exactly n 1's in its decimal representation.
|
|
1
|
|
|
1, 3, 9, 22, 36, 26, 33, 65, 92, 82, 54, 111, 89, 105, 131, 146, 149, 189, 187, 212, 192, 204, 182, 200, 252, 210, 307, 247, 268, 304, 300, 338, 313, 333, 404, 417, 363, 421, 355, 433, 485, 481, 451, 458, 521, 505, 551, 489, 497, 575, 608
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
MAPLE
|
N:= 100: # to get a(0)..a(N)
V:= Array(0..N): count:= 0:
for n from 0 while count < N do
v:= numboccur(1, convert(5^n, base, 10));
if v <= N and V[v] = 0 then
count:= count+1; V[v]:= n;
fi;
od:
|
|
MATHEMATICA
|
a = {}; Do[k = 1; While[ Count[ IntegerDigits[5^k], 1] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
Join[{1, 3}, With[{k=5^Range[0, 2000]}, Flatten[Table[Position[k, _?(DigitCount[ #, 10, 1]==n&), 1, 1], {n, 2, 100}]]]-1] (* Much faster than above program but Range constant may limit accuracy if more terms are sought. *) (* Harvey P. Dale, Jul 18 2019 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|