|
|
A131546
|
|
Least power of 3 having exactly n consecutive 7's in its decimal representation.
|
|
10
|
|
|
3, 11, 112, 184, 721, 3520, 6643, 12793, 67448, 208380, 364578, 1123485, 9549790, 23340555, 88637856
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2) = 11 because 3^11 = 177147 is the smallest power of 3 to contain a run of two consecutive 7's in its decimal form.
|
|
MATHEMATICA
|
a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 10} ]
|
|
PROG
|
(Python)
....str7 = '7'*n
....x, exponent = 3, 1
....while not str7 in str(x):
........exponent += 1
........x *= 3
|
|
CROSSREFS
|
|
|
KEYWORD
|
more,nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|