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

Emirps p such that, if q is the next emirp after p, p*q mod (p+q) and floor(p*q/(p+q)) are both emirps.
1

%I #10 Jan 25 2022 04:21:36

%S 15733,15803,18413,19037,37243,75913,157363,371057,393919,396509,

%T 705169,722983,740477,794141,1857599,1858093,1858643,1865491,1918529,

%U 1922351,1950989,3002977,3006551,3007723,3127139,3234857,3266369,3444017,3548891,3614339,3658981,3687127,3734657,3763567,3807173

%N Emirps p such that, if q is the next emirp after p, p*q mod (p+q) and floor(p*q/(p+q)) are both emirps.

%H Robert Israel, <a href="/A350884/b350884.txt">Table of n, a(n) for n = 1..2000</a>

%e a(3) = 18413 = p is a term because it is an emirp (18413 and 31481 being distinct primes), the next emirp is q = 18427, and (p*q) mod (p+q) = 36791 and floor((p*q)/(p+q)) = 9209 are emirps.

%p rev:= proc(n) local L,i;

%p L:= convert(n,base,10);

%p add(L[-i]*10^(i-1),i=1..nops(L))

%p end proc:

%p isemirp:= proc(n) local r;

%p if not isprime(n) then return false fi;

%p r:= rev(n);

%p r <> n and isprime(r)

%p end proc:

%p R:= NULL: count:= 0:

%p p:= 0:

%p for d from 1 while count < 40 do

%p for i in [1,3,7,9] do

%p for j from 1 to 10^d-1 by 2 while count < 40 do

%p q:= i*10^d+j;

%p if isemirp(q) then

%p s:= p+q;

%p t:= p*q;

%p if isemirp(t mod s) and isemirp(floor(t/s)) then

%p count:= count+1; R:= R, p;

%p fi;

%p p:= q;

%p fi;

%p od od od;

%p R;

%t emirpQ[p_] := (q = IntegerReverse[p]) != p && And @@ PrimeQ[{p, q}]; nextEmirp[p_] := Module[{k = NextPrime[p]}, While[(q = IntegerReverse[k]) == k || ! PrimeQ[q], k = NextPrime[k]]; k]; seqQ[p_] := emirpQ[p] && Module[{q = nextEmirp[p]}, And @@ emirpQ /@ {Mod[p*q, p + q], Floor[p*q/(p + q)]}]; Select[Range[2*10^6], seqQ] (* _Amiram Eldar_, Jan 21 2022 *)

%Y Cf. A006567, A346147.

%K nonn,base

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 20 2022