login
Primes p that divide both 3^k-2 and 5^k-1 for some k.
0

%I #23 Feb 24 2023 19:32:27

%S 31,601,2593,20478961,204700049,668731841

%N Primes p that divide both 3^k-2 and 5^k-1 for some k.

%C If prime p divides 3^k-2 and 5^k-1, then p divides 3^j-2 and 5^j-1 for all j such that j == k (mod p-1).

%C Primes p such that the equation 3^(x*A070677(p)) == 2 (mod p) has a solution.

%C Values of k: 24, 108, 64, 376020, 67141466, 487515840, ... - _Chai Wah Wu_, Feb 24 2023

%e a(3) = 2593 is a term because 2593 is prime, 3^64 == 2 (mod 2593) and 5^64 == 1 (mod 2593).

%p R:= NULL: count:= 0: p:= 5: with(numtheory):

%p while count < 4 do

%p p:= nextprime(p);

%p if mlog(2,3 &^ order(5,p) mod p, p) <> FAIL then R:= R,p; count:= count+1 fi

%p od:

%p R;

%o (Python)

%o from itertools import islice

%o from sympy import discrete_log, nextprime, n_order

%o def A360761_gen(): # generator of terms

%o p = 5

%o while True:

%o try:

%o discrete_log(p:=nextprime(p),2,pow(3,n_order(5,p),p))

%o except:

%o continue

%o yield p

%o A360761_list = list(islice(A360761_gen(),4)) # _Chai Wah Wu_, Feb 23 2023

%Y Cf. A070677.

%K nonn,more

%O 1,1

%A _Robert Israel_, Feb 19 2023

%E a(5)-a(6) from _Chai Wah Wu_, Feb 23 2023