OFFSET
1,2
COMMENTS
For n >= 2, a(n) == 3 (mod 6) if it exists.
a(6) > 3 * 10^9 if it exists.
No further terms < 10^11, testing all odd numbers (see Python program). - Michael S. Branicky, Sep 08 2024
EXAMPLE
a(3) = 22557: 22557^2 = 508818249, 22557^3 = 11477413242693, and the concatenations 122557, 122557508818249, and 12255750881824911477413242693 are all prime.
MAPLE
tcat:= (a, b) -> a*10^(1+ilog10(b))+b:
k:= 2: R:= 1:
for n from 2 to 5 do
for j from k by 6 do
c:= 1; good:= true;
for i from 1 to n while good do
c:= tcat(c, j^i);
if not isprime(c) then good:= false; break fi
od;
if good then k:= j; R:= R, j; break fi
od od:
R;
PROG
(Python)
from itertools import count
from gmpy2 import is_prime, mpz, digits
def f(k):
i, s = 0, "1"
while True:
ski = digits(k**(i+1))
if not is_prime(mpz(s+ski)):
break
i, s = i+1, s+ski
return i
def afind():
adict = dict()
for m in count(1, 2): # or count(3, 6) for a(2) on per comment
v = f(m)
if v > 0 and v not in adict:
adict[v] = m
print("FOUND", m, v)
afind() # Michael S. Branicky, Sep 08 2024
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Sep 06 2024
EXTENSIONS
a(6) from Michael S. Branicky, Sep 09 2024
STATUS
approved