A356791 Emirps p such that R(p) > p and R(p) mod p is prime, where R(p) is the reversal of p.
13, 17, 107, 149, 337, 1009, 1069, 1109, 1409, 1499, 1559, 3257, 3347, 3407, 3467, 3527, 3697, 3767, 10009, 10429, 10739, 10859, 10939, 11057, 11149, 11159, 11257, 11497, 11657, 11677, 11717, 11897, 11959, 13759, 13829, 14029, 14479, 14549, 15149, 15299, 15649, 30367, 30557, 31267, 31307, 32257
Offset: 1
Examples
a(3) = 107 is a term because it is prime, its reversal 701 is prime, and 701 mod 107 = 59 is prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
rev:= proc(n) local K,i; K:= convert(n,base,10); add(K[-i]*10^(i-1),i=1..nops(K)) end proc: filter:= proc(p) local q; if not isprime(p) then return false fi; q:= rev(p); q > p and isprime(q) and isprime(q mod p) end proc: select(filter, [seq(i,i=3..10^5,2)]);
-
Mathematica
q[p_] := Module[{r = IntegerReverse[p]}, r > p && PrimeQ[r] && PrimeQ[Mod[r, p]]]; Select[Prime[Range[3500]], q] (* Amiram Eldar, Sep 18 2022 *)
-
Python
from sympy import isprime def ok(n): r = int(str(n)[::-1]) return r > n and isprime(n) and isprime(r) and isprime(r%n) print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Sep 18 2022
Comments