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

Home > Just Math
Prime Symphony (Posted on 2024-07-01) Difficulty: 3 of 5
Determine all pairs of prime numbers p and q less than 100, such that the following five numbers:

p+6, p+10, q+4, q+10, p+q+1

are all prime numbers.

No Solution Yet Submitted by Danish Ahmed Khan    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 3 of 5 |
[p, q] = [7, 3], [13, 3], [37, 3], [97, 3]

If p were 1 mod 3, p+10 would be divisible by 3 and not prime.  
If p were 0 mod 3, p+6 would be divisible by 3 and not prime.
So p is always 1 mod 3 (and odd, thus 1 mod 6).

If q could be 2 mod 3 then q+4 and q+10 would be divisible by 3 and not prime.
But if q could be 1 mod 3, then p+q+1 would be divisible by 3 and not prime.
So q must be 0 mod 3, and the only such prime is 3 itself.
Thus q = 3.

-------
big = 100
primes = [n for n in range(big) if isprime(n)]
bigpms = primes + [n for n in range(big, 2*big) if isprime(n)]
ans = []

q=3
for p in primes:    
    if p + 6 not in bigpms:
        continue
    if p + 10 not in bigpms:
        continue
    if q + 4 not in bigpms:
        continue
    if q + 10 not in bigpms:
        continue
    if p + q + 1 not in bigpms:
        continue
    ans.append([p,q])
print(ans)

  Posted by Larry on 2024-07-01 17:14:58
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 (3)
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