login
Numbers k such that for all pairs of primes p,q with p+q = 2*k, p*q mod 2*k is prime.
1

%I #8 Dec 30 2021 07:27:46

%S 1,3,4,6,7,8,9,10,11,12,13,14,15,16,21,24,30,31,34,36,42,45,49,63

%N Numbers k such that for all pairs of primes p,q with p+q = 2*k, p*q mod 2*k is prime.

%C a(25) > 10^6 if it exists.

%C Numbers k such that A350399(k) = A002375(k).

%e a(5) = 7 is a term because 2*7 = 14 = 3+11 = 7+7, with 3*11 == 5 (mod 14) and 7*7 == 7 (mod 14), and both 5 and 7 are prime.

%e 5 is not a term because 2*5 = 10 = 3+7 = 5+5, but 3*7 == 1 (mod 10) and 1 is not prime.

%p filter:= proc(k) local p;

%p p:= 1;

%p while p <= k do

%p p:= nextprime(p);

%p if isprime(2*k-p) and not isprime(-p^2 mod 2*k) then return false fi

%p od;

%p true

%p end proc:

%p select(filter, [$1..1000]);

%t q[k_] := AllTrue[Select[Range[2, 2*k], PrimeQ], ! PrimeQ[2*k - #] || PrimeQ[Mod[#*(2*k - #), 2*k]] &]; Select[Range[100], q] (* _Amiram Eldar_, Dec 28 2021 *)

%Y Cf. A002375, A350399.

%K nonn,more

%O 1,2

%A _J. M. Bergot_ and _Robert Israel_, Dec 28 2021