login
A397341
a(1) = 1; for n > 1, a(n) is the concatenation of a(n-1) and the smallest prime p such that the concatenation a(n-1) | p is prime.
2
1, 13, 137, 1373, 137341, 1373417, 137341723, 1373417237, 137341723789, 1373417237893, 1373417237893139, 137341723789313929, 137341723789313929643, 137341723789313929643419, 13734172378931392964341943, 1373417237893139296434194329, 137341723789313929643419432937, 13734172378931392964341943293729
OFFSET
1,2
COMMENTS
This sequence is similar to A158191, but starts with 1 instead of prime 2.
The corresponding sequence of appended primes are in A397342.
Conjecture: a(n) exists for all n. Equivalently, for every F >= 1, there is a prime p such that F*10^d(p) + p is prime.
For a fixed F and a k-digit prime p, the number F*10^k + p is roughly of size F*10^k, so the probability that it is prime is approximately 1/log(F*10^k) ≈ 1/(k log 10). Since there are about 10^k/k primes with k digits, the expected number of successes for a given k is about 10^k/k^2, which tends to infinity. Thus, the construction should never get stuck. This is consistent with the Bateman-Horn conjecture and Schinzel's Hypothesis H.
a(281) has 1005 digits. - Michael S. Branicky, Jun 24 2026
FORMULA
a(1) = 1; for n > 1, let p_{n-1} be the smallest prime such that a(n) = a(n-1) * 10^{d(p_{n-1})} + p_{n-1} is prime, where d(p) denotes the number of decimal digits of p.
EXAMPLE
a(1) = 1.
a(2) = 13 since 1|3 = 13 is prime (but 1|2 = 12 is not).
a(3) = 137 since 13|7 = 137 is prime (but 132, 133 and 135 are not).
a(4) = 1373 since 137|3 = 1373 is prime (but 137|2 = 1372 is not).
MATHEMATICA
next[F_] := NestWhile[NextPrime, 2, ! PrimeQ[F*10^IntegerLength[#] + #] &];
F = 1; seq = {1};
Do[p = next[F]; F = F*10^IntegerLength[p] + p; AppendTo[seq, F], {20}];
seq
PROG
(Python)
import sympy as sp
def anext(term):
k = 1
while True:
for p in sp.primerange(10**(k-1), 10**k):
candidate = int(str(term) + str(p))
if sp.isprime(candidate):
return p, candidate
k += 1
an = 1
a = [an]
for n in range(1, 18):
p, an = anext(an)
a.append(an)
print(a)
CROSSREFS
Cf. A397342 (appended primes).
Cf. A000945 (Euclid-Mullin), A167604 (variant of Euclid-Mullin).
Sequence in context: A142017 A157950 A249444 * A046278 A016205 A083755
KEYWORD
nonn,base
AUTHOR
STATUS
approved