All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Prime power pairs (Posted on 2023-07-16) Difficulty: 2 of 5
Find all pairs of prime numbers p and q that satisfy the equation 3pq-2qp-1=19.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
I found | Comment 1 of 7
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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information