Checking integers up to 4000, I found two solutions for (p,q):
(3, 2)
(7, 2)
But I did not prove there are no others.
---------------
def isprime(n):
'''check if integer n is a prime'''
n = abs(int(n))
if n < 2:
return False
if n == 2:
return True
if not n & 1:
return False
for x in range(3, int(n**0.5)+1, 2):
if n % x == 0:
return False
return True
solutions = []
primes = [i for i in range(4000) if isprime(i)]
from itertools import combinations
for co in combinations(primes,2):
p=co[0]
q=co[1]
if 3*p**q - 2*q**(p-1) == 19:
if [p,q] not in solutions:
print([p,q])
solutions.append([p,q])
if 3*q**p - 2*p**(q-1) == 19:
if [q,p] not in solutions:
print([q,p])
solutions.append([q,p])
|
Posted by Larry
on 2023-07-16 11:53:03 |