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

A345408
Numbers that are the sum of an emirp and its reversal in more than one way.
3
1090, 2662, 2992, 3212, 4334, 4994, 5104, 5324, 6776, 7106, 9328, 9548, 10450, 10670, 10780, 11110, 11330, 11440, 11660, 12122, 12452, 12892, 13222, 15004, 16786, 17446, 17666, 29092, 29482, 31912, 36352, 44644, 44834, 45454, 46654, 46664, 47474, 47864, 49094, 49294, 49484, 49684, 49894, 50104
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
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
Sequence in context: A274755 A023101 A169977 * A031744 A031654 A031531
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jun 18 2021
STATUS
approved