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

Home > Numbers
Some Prime Squares Sum Cube (Posted on 2023-05-21) Difficulty: 3 of 5
Find all triplet(s) (p, q, r) of prime numbers, that satisfy this equation:
          p3 = p2 + q2 + r2
Justify your answer with valid reasoning.

See The Solution Submitted by K Sengupta    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution but not analytic | Comment 1 of 4
The only one found is (3,3,3).

Analytic beginning:
If p=q=r, then p^3 = 3*p^2 for which p=3 is the only solution.
(p=0 solves but is not a prime).

p,q,r are not necessarily all equal:
p^3 = p^2 + q^2 + r^2
p^3 - p^2 = q^2 + r^2
p^2(p-1) = q^2 + r^2

and here I cannot see how to proceed.  I note that (p-1) happens to be a prime only if p=3, but I am not sure that is relevant.

----------
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
primes = [i for i in range (1000) if isprime(i)]
solutions = []
for p in primes:
    for q in primes:
        for r in primes:
            if p**3 == p**2 + q**2 + r**2:
                print([p,q,r])
                if sorted([p,q,r]) not in solutions:
                    solutions.append(sorted([p,q,r]))

  Posted by Larry on 2023-05-21 10:38:40
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