PerfectNumberQ

PerfectNumberQ[n]

returns True if n is a perfect integer, and False otherwise.

Details

  • A positive integer n is perfect if and only if the sum of all its divisors equals 2n.
  • Numbers 0 and 1 are not perfect.

Examples

open allclose all

Basic Examples  (2)

Test whether a number is perfect:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Find all perfect numbers smaller than 10000:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Properties & Relations  (7)

Possible Issues  (1)

See Also

PerfectNumber  Divisors  DivisorSigma  MersennePrimeExponentQ

Introduced in 2016
(10.4)