ZCubes/Mersenne Primes and Perfect Numbers

From ZCubes Wiki
Jump to: navigation, search

Mersenne Primes and Perfect Numbers

Mersenne prime is a prime number that is one less than a power of two. That is, it is a prime number of the form 2n − 1 for some integer n. There are also connected to perfect numbers. The largest known prime number, 282,589,933 − 1, is a Mersenne prime. Finding Mersenne prime and validating it is a computation intensive task. This video demonstrates how to generate Mersenne primes using ZCubes, and will also explore the relationship with Perfect numbers.


Mersenne Primes and Perfect Numbers



--> The above code displays the list of Mersenne Prime Numbers for the range upto 700. This calculation deals with large calculations hence an 'n' is added in code for more accuracy.


-->The above code calculates Perfect Numbers in range upto 10,000. Perfect number, a positive integer that is equal to the sum of its proper divisors.This gives the list of numbers 1,6,28,496 and 8,128.

Relationship between Mersenne Primes and Perfect Numbers:
If Mersenne Prime is 'x' then 'x*(x+1)/2' results into the Perfect Number.


<< Learn ZCubes
© Copyright 1996-2020, ZCubes, Inc.