login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343145
a(n) is the least positive number k such that applying x->prime(x) n times results in a number that ends in k.
1
1, 7, 6447, 7, 1, 1, 69, 9, 1, 1, 1, 7, 1, 1
OFFSET
0,2
EXAMPLE
a(1) = 7 since prime(7) = 17 which ends in 7.
a(2) = 6447 since prime(prime(6447)) = 806447 which ends in 6447.
a(3) = 7 since prime(prime(prime(7)))=277 which ends in 7.
a(4) = 1 since prime(prime(prime(prime(1)))) = 11 which ends in 1.
a(5) = 1 since prime(prime(prime(prime(prime(1))))) = 31 which ends in 1.
a(6) = 69 since prime(prime(prime(prime(prime(prime(69)))))) = 54615469 which ends in 69.
a(7) = 9 since prime(prime(prime(prime(prime(prime(prime(9))))))) = 4535189 which ends in 9.
PROG
(Python)
def A343145(n):
k = 1
while True:
m = k
for _ in range(n):
m = prime(m)
if m % 10**(len(str(k))) == k:
return k
k += 1
while not (k % 2 and k % 5):
k += 1
(PARI) primemap(n, tms) = my(x=n); for(i=1, tms, x=prime(x)); x
enddigits(n, len) = ((n/10^len - floor(n/10^len)) * 10^len)
a(n) = for(k=1, oo, my(x=k); if(enddigits(primemap(k, n), #Str(k))==k, return(k))) \\ Felix Fröhlich, Apr 14 2021
CROSSREFS
KEYWORD
nonn,hard,base,more
AUTHOR
Chai Wah Wu, Apr 06 2021
STATUS
approved