A345409 Numbers that are the sum of an emirp and its reversal.
44, 88, 110, 176, 424, 808, 908, 928, 1070, 1090, 1150, 1190, 1312, 1372, 1616, 1676, 1736, 2222, 2332, 2552, 2662, 2992, 3212, 4114, 4334, 4444, 4664, 4774, 4994, 5104, 5324, 5434, 6226, 6776, 6886, 7106, 7436, 8338, 8558, 8998, 9218, 9328, 9548, 10010, 10120, 10450, 10670, 10780, 11000, 11110
Offset: 1
Keywords
Examples
a(3) = 110 is a member because 110 = 37+73 where 37 is an emirp.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
revdigs:= proc(n) local L,i; L:= convert(n,base,10); add(L[-i]*10^(i-1),i=1..nops(L)) end proc: f:= proc(n) local r; if not isprime(n) then return NULL fi; r:= revdigs(n); if r > n and isprime(r) then return r+n fi end proc: S:= map(f, {seq(seq(seq(i*10^d+j,j=1..10^d-1,2),i=[1,3,7,9]),d=1..4)}): sort(convert(S,list));
-
Python
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): epsums = set(sum(ep) for ep in epgen(1, lim)) return sorted(filter(lambda x: x<=lim, epsums)) print(aupto(11111)) # Michael S. Branicky, Jun 18 2021