cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356791 Emirps p such that R(p) > p and R(p) mod p is prime, where R(p) is the reversal of p.

This page as a plain text file.
%I A356791 #55 Sep 24 2022 21:51:04
%S A356791 13,17,107,149,337,1009,1069,1109,1409,1499,1559,3257,3347,3407,3467,
%T A356791 3527,3697,3767,10009,10429,10739,10859,10939,11057,11149,11159,11257,
%U A356791 11497,11657,11677,11717,11897,11959,13759,13829,14029,14479,14549,15149,15299,15649,30367,30557,31267,31307,32257
%N A356791 Emirps p such that R(p) > p and  R(p) mod p is prime, where R(p) is the reversal of p.
%C A356791 All terms start with digit 1 or 3.
%C A356791 It appears that the only term that does not end with digit 7 or 9 is 13.
%H A356791 Robert Israel, <a href="/A356791/b356791.txt">Table of n, a(n) for n = 1..10000</a>
%e A356791 a(3) = 107 is a term because it is prime, its reversal 701 is prime, and 701 mod 107 = 59 is prime.
%p A356791 rev:= proc(n) local K,i;
%p A356791   K:= convert(n,base,10);
%p A356791   add(K[-i]*10^(i-1),i=1..nops(K))
%p A356791 end proc:
%p A356791 filter:= proc(p) local q;
%p A356791   if not isprime(p) then return false fi;
%p A356791   q:= rev(p);
%p A356791   q > p and isprime(q) and isprime(q mod p)
%p A356791 end proc:
%p A356791 select(filter, [seq(i,i=3..10^5,2)]);
%t A356791 q[p_] := Module[{r = IntegerReverse[p]}, r > p && PrimeQ[r] && PrimeQ[Mod[r, p]]]; Select[Prime[Range[3500]], q] (* _Amiram Eldar_, Sep 18 2022 *)
%o A356791 (Python)
%o A356791 from sympy import isprime
%o A356791 def ok(n):
%o A356791     r = int(str(n)[::-1])
%o A356791     return r > n and isprime(n) and isprime(r) and isprime(r%n)
%o A356791 print([k for k in range(10**5) if ok(k)]) # _Michael S. Branicky_, Sep 18 2022
%Y A356791 Cf. A004086, A006567, A109308.
%K A356791 nonn,base
%O A356791 1,1
%A A356791 _J. M. Bergot_ and _Robert Israel_, Sep 18 2022