RosettaCodeData/Task/Perfect-numbers/00-TASK.txt

26 lines
1.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[[category:Discrete math]]
{{task|Prime Numbers}}
{{task|Numbers}}
Write a function which says whether a number is perfect.
<br>
[[wp:Perfect_numbers|A perfect number]] is a positive integer that is the sum of its proper positive divisors excluding the number itself.
Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself).
Note: &nbsp; The faster &nbsp; [[Lucas-Lehmer test]] &nbsp; is used to find primes of the form &nbsp; <big> 2<sup>''n''</sup>-1</big>, &nbsp; all ''known'' perfect numbers can be derived from these primes
using the formula &nbsp; <big> (2<sup>''n''</sup> - 1) × 2<sup>''n'' - 1</sup></big>.
It is not known if there are any odd perfect numbers (any that exist are larger than <big>10<sup>2000</sup></big>).
The number of &nbsp; ''known'' &nbsp; perfect numbers is &nbsp; '''51''' &nbsp; (as of December, 2018), &nbsp; and the largest known perfect number contains &nbsp;'''49,724,095'''&nbsp; decimal digits.
;See also:
:* &nbsp; [[Rational Arithmetic]]
:* &nbsp; [[oeis:A000396|Perfect numbers on OEIS]]
:* &nbsp; [http://www.oddperfect.org/ Odd Perfect] showing the current status of bounds on odd perfect numbers.
<br><br>