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”).

A376027
a(n) is the least k such that the concatenations of k^i, i=0..j, are prime for j from 1 to n.
0
1, 3, 22557, 354081, 419163, 286623930087
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
Cf. A096469.
Sequence in context: A128121 A112406 A344681 * A171364 A307670 A115475
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Sep 06 2024
EXTENSIONS
a(6) from Michael S. Branicky, Sep 09 2024
STATUS
approved