Problem
Java
my solution
There is one fact that odd perfect numbers are greater than \( 10^{1500} \) if exist. By Euclid–Euler theorem, there is a one-to-one relationship between even perfect numbers and Mersenne primes. Even perfect number have the form as \( 2^{p−1}(2^p−1) \).
1 | class Solution { |
Submission Detail
- 156 / 156 test cases passed.
- Runtime: 0 ms, faster than 100.00% of Java online submissions for Perfect Number.
- Memory Usage: 37.7 MB, less than 23.24% of Java online submissions for Perfect Number.