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

Home > Numbers
Valid Prime Number Pairs (Posted on 2023-08-03) Difficulty: 3 of 5
Find all possible pairs (m,n) of prime numbers that satisfy this equation:
            2m = 2n-2 + n!
Prove that there are no other valid pair that conform to the given conditions.

*** Computer program assisted solutions are welcome, but a semi-analytic (hand calculator and p&p solution) is preferred.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer Solution | Comment 1 of 2
I found two solutions:
(m,n) = {(3,3), (7,5)}

-------------------
def fact(n):
    if n == 1 or n == 0:
        return 1
    ans = 1
    for i in range(n):
        ans *= (i+1)
    return ans

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(1001) if isprime(i)]
for m in primes:
    for n in primes:
        if 2**m == 2**(n-2) + fact(n):
            print(m,n)
  Posted by Larry on 2023-08-03 11:41:22
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 (13)
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