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

Home > Just Math
Prime pair (Posted on 2023-11-17) Difficulty: 3 of 5
Find all pairs (p,q) of prime numbers such that

p(p2-p-1)=q(2q+3)

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 1 of 3
(p=13, q=31) is the only solution testing primes up to 10,000

primes = [p for p in range(10000) if isprime(p)]
for p in primes:
    for q in primes:
        if p*(p**2-p-1) == q*(2*q+3):
            print('(p={}, q={})'.format(p,q))

note:
Even if you allow non-primes, all integers including zero and negatives, there are not that many solutions (testing up to 10,000):
(p=-1, q=-1)
(p=0, q=0)
(p=1, q=-1)
(p=2, q=-2)
(p=4, q=4)
(p=13, q=31)
(p=35, q=-145)
(p=81, q=-513)

  Posted by Larry on 2023-11-17 11:15:19
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (2)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
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