Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The even perfect numbers all have the formula

    2^(p - 1)(2^p - 1)
for some prime `p`. In code that's

    ((1 << p) - 1) << (p - 1)
for `p` = 2, 3, 5, 7 and 13, which is why you're seeing that interesting pattern of bits.

(There are no odd perfect numbers in the range under consideration.)



You should also note that there are no known odd perfect numbers, period. Any that do exist must exceed 10^1500.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: