OFFSET
1,1
COMMENTS
Conjecture: The image of this sequence joined with {2, 5} are the prime numbers, {2, 5} union imag(a) = P.
LINKS
Sam Sweet, Table of n, a(n) for n = 1..500
MAPLE
P := select(isprime, [seq(2..405)]):
g := p -> local q;
for q in P do
if isprime(q + (p + q)*10^(1 + ilog10(q))) then return q fi
od:
map(g, P);
MATHEMATICA
spq[p_]:=Module[{k=2}, While[!PrimeQ[(p+k)*10^IntegerLength[k]+k], k=NextPrime[k]]; k]; Table[spq[p], {p, Prime[Range[80]]}] (* Harvey P. Dale, Sep 24 2024 *)
PROG
(SageMath)
def f(p):
for q in Primes():
if is_prime(q + (p + q)*10^(1 + int(log(q, 10)))): return q
print([f(p) for p in prime_range(405)])
(PARI)
a(n) = my(k=2); while (!isprime(eval(concat(Str(prime(n)+k), Str(k)))), k = nextprime(k+1)); k; \\ Michel Marcus, Sep 17 2024
(Python)
from itertools import count
from sympy import prime, isprime, nextprime
def A375553(n):
p, q, m = prime(n), 2, 10
for l in count(1):
while q<m:
if isprime(m*(p+q)+q):
return q
q = nextprime(q)
m *= 10 # Chai Wah Wu, Sep 18 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Sep 17 2024
STATUS
approved