%I #10 Nov 17 2020 01:34:46
%S 1885,4433,13949,30709,39479,41287,53627,55709,56173,61957,63779,
%T 64897,78217,79553,85951,90097,92983,97679,99517,101491,101803,102131,
%U 103621,107821,115915,119153,121481,121619,128573,135439,141349,141607,143117,145337,146497,146557,148219,152233,159619,164083
%N Products p*q*r of three distinct primes such that s=(p*q) mod r, t=(p*r) mod q and u=(q*r) mod p, and s+t+u are all prime.
%H Robert Israel, <a href="/A338705/b338705.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3)=13949 is a member because 13949 = 13*29*37 with s = (13*29) mod 37 = 7, t = (13*37) mod 29 = 17, u = (29*37) mod 13 = 7, and 7+17+7 = 31, all prime.
%p N:= 10^6: # for terms <= N
%p P:= select(isprime, [seq(i,i=3..floor(sqrt(N)),2)]):
%p R:= NULL:
%p for i from 1 to nops(P) do
%p p:= P[i];
%p for j from 1 to i-1 do
%p q:= P[j];
%p if 3*q*p > N then break fi;
%p for k from 1 to j-1 do
%p r:= P[k];
%p if r*q*p > N or r >= p*q then break fi;
%p s:= p*q mod r; t:= p*r mod q; u:= q*r mod p;
%p if isprime(s) and isprime(t) and isprime(u) and isprime(s+t+u)
%p then R:= R, p*q*r
%p fi;
%p od od od:
%p sort([R]);
%t Block[{a = {}, nn = 164500}, Do[Do[Do[If[And[Length@ Union[{#1, #2, #3}] == 3, AllTrue[{##}~Join~{#1 + #2 + #3} & @@ {Mod[#1 #2, #3], Mod[#1 #3, #2], Mod[#2 #3, #1]}, PrimeQ]], AppendTo[a, #1 #2 #3]] & @@ {Prime[i], Prime[j], Prime[k]}, {k, j - 1}], {j, i - 1}], {i, PrimePi@ Floor[Sqrt[nn]]}]; TakeWhile[Union@ a, # <= nn &]] (* _Michael De Vlieger_, Nov 05 2020 *)
%Y Subset of A338704.
%K nonn
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Nov 05 2020