RosettaCodeData/Task/Perfect-numbers/00DESCRIPTION

22 lines
1.1 KiB
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
Write a function which says whether a number is perfect.
2016-12-05 22:15:40 +01:00
<br>
[[wp:Perfect_numbers|A perfect number]] is a positive integer that is the sum of its proper positive divisors excluding the number itself.
2013-04-10 23:57:08 -07:00
2016-12-05 22:15:40 +01:00
Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself).
2013-04-10 23:57:08 -07:00
2016-12-05 22:15:40 +01:00
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>).
2019-09-12 10:33:56 -07:00
The number of &nbsp; ''known'' &nbsp; perfect numbers is &nbsp; '''50''' &nbsp; (as of September, 2018), &nbsp; and the largest known perfect number contains over '''46''' million decimal digits.
2016-12-05 22:15:40 +01:00
;See also:
2019-09-12 10:33:56 -07:00
:* &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.
2016-12-05 22:15:40 +01:00
<br><br>