Just press the green flag and watch the magic. Sadly the way scratch does math with big numbers anything higher than 17 digits (AKA 9th and above) will be at least a bit inaccurate :( How did I Make this one of the fastest? Almost no one else uses the Lucas Lehmer test. It is the fastest known way to find Mersenne primes, but for some reason I couldn’t find many other projects that use it. How do I know it’s the fastest? Because I couldn’t find any other projects that could accurately calculate the 8th perfect number in less than a second. And mine can.
I coded all of this myself and how I did it is below here and in the code as notes. “Perfect numbers are those numbers that equal the sum of all their divisors including 1 and excluding the number itself.” -NASA’s official website. What this does is it goes through all the natural numbers and checks if they are prime. Then if it is it will check if it fits the Mersenne prime Formula. And if it does, the prime and its corresponding Mersenne prime will be put in the formula for a perfect number. Feel free to look inside to see how it works for yourself.