OFFSET
1,1
COMMENTS
Numbers that are in A345409 in more than one way.
Interchanging an emirp and its reversal is not counted as a different way.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 2992 is a member because 2992 = 1091 + 1901 = 1181+1811 where 1091 and 1181 and their reversals 1901 and 1811 are primes.
MAPLE
revdigs:= proc(n) local L, i; L:= convert(n, base, 10); add(L[-i]*10^(i-1), i=1..nops(L)) end proc:
isemirp1:= proc(n) local r;
if not isprime(n) then return false fi;
r:= revdigs(n);
r > n and isprime(r)
end proc:
E:= select(isemirp1, [seq(seq(seq(i*10^d+j, j=1..10^d-1, 2), i=[1, 3, 7, 9]), d=1..4)]):
V:= sort(map(t -> t+revdigs(t), E)):
M:= select(t -> V[t+1]=V[t], [$1..nops(V)-1]):
sort(convert(convert(V[M], set), list));
PROG
(Python)
from collections import Counter
from sympy import isprime, nextprime
def epgen(start=1, end=float('inf')): # generates unique emirp/prime pairs
p = nextprime(start-1)
while p <= end:
revp = int(str(p)[::-1])
if p < revp and isprime(revp): yield (p, revp)
p = nextprime(p)
def aupto(lim):
c = Counter(sum(ep) for ep in epgen(1, lim) if sum(ep) <= lim)
return sorted(s for s in c if c[s] > 1)
print(aupto(50105)) # Michael S. Branicky, Jun 18 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jun 18 2021
STATUS
approved