|
|
A363196
|
|
a(n) is the least k such that the rightmost 7 in the decimal expansion of 3^k is in the (10^n)'s position, or -1 if there is no such k.
|
|
0
|
|
|
3, -1, 6, 37, 50, 14, 18, 38, 28, 25, 48, 188, 34, 93, 45, 40, 44, 134, 54, 60, 96, 86, 61, 81, 229, 57, 133, 321, 89, 412, 628, 210, 200, 257, 429, 256, 313, 672, 885, 530, 2418, 649, 270, 641, 848, 258, 2676, 121, 450, 1448, 3254, 696, 9857, 4961, 804, 6101, 1049, 1476, 5044, 3186, 437, 12560
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Conjecture: a(n) = -1 only for n = 1.
|
|
LINKS
|
|
|
EXAMPLE
|
a(4) = 50 because 3^50 = 717897987691852588770249 has its rightmost 7 in the (10^4)'s position, and no k < 50 works.
|
|
MAPLE
|
W:= Array(0..70): count:= 0: W[1]:= -1:
for k from 1 while count < 70 do
L:= convert(3^k, base, 10);
for j from 1 to min(nops(L), 101) do
if L[j] = 7 then
if W[j-1] = 0 then W[j-1]:= k; count:= count+1; fi;
break
fi
od
od:
convert(W[0..70], list);
|
|
PROG
|
(Python)
from itertools import count
def aupto(N):
M, adict, n, k = 10**(N+1), {-1:None, 0:3, 1:-1}, 0, 0
while n < N:
while n in adict: yield adict[n]; n += 1
v = str(pow(3, k, M))[::-1].find("7")
if v not in adict:
adict[v] = k
k += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|