OFFSET
0,1
COMMENTS
Conjecture: a(n) = -1 only for n = 1.
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
print(list(aupto(62))) # Michael S. Branicky, May 21 2023
CROSSREFS
KEYWORD
sign,base
AUTHOR
Robert Israel, May 20 2023
STATUS
approved