Question: A perfect number is a positive integer n that equals the sum of all divisors less than n . For example, 6 is a perfect

A perfect number is a positive integer n that equals the sum of all divisors less than n. For example, 6 is a perfect number because 6=1+2+3. Perfect numbers are related to Mersenne primes in that if p is a prime and pow (2, p)1 is a prime, then pow (2, p 1)(pow (2, p)1) is a perfect number.
write a Python function that proves this claim for all prime numbers n less than 12. Your program shouldcheck if n is prime and if so, output n, pow (2,n 1)(pow (2,n)1) and also all divisors of pow (2,n 1)(pow (2,n)1) to prove that pow (2,n 1)(pow (2,n)1) is a perfect number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!