PerfectNumberQ

PerfectNumberQ[n]

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

Details

  • PerfectNumberQ is typically used to test whether an integer is a perfect number.
  • A positive integer n is a perfect number if the sum of all its divisors is 2n.
  • PerfectNumberQ[n] returns False unless n is manifestly a perfect number.

Examples

open allclose all

Basic Examples  (2)

Test whether a number is perfect:

The number 12 is not perfect:

Scope  (5)

PerfectNumberQ works over positive integers:

Gaussian integers:

Negative integers are not perfect:

Nonintegers are not perfect:

Test for large integers:

Applications  (10)

Basic Applications  (2)

Highlight perfect numbers:

Generate perfect number:

Generate random perfect numbers:

Number Theory  (8)

Even perfect numbers end in either 6 or 28:

Triangular numbers of Mersenne primes are perfect numbers:

Hexagonal numbers related to Mersenne prime exponents are perfect numbers:

Having the form , each even perfect number is the ^(th) triangular number and the ^(th) hexagonal number:

If p is a Mersenne prime exponent, then is a perfect number:

Every even perfect number has the form , where p is a Mersenne prime exponent:

Check that in the representation above p is 5:

The reciprocals of the divisors of a perfect number n must add up to :

A number n is -perfect if the sum of the divisors of n is equal to :

Find -Perfect numbers:

A perfect number is the same thing as a -perfect number:

Properties & Relations  (6)

A positive integer n is perfect if and only if the sum of all its divisors equals :

PerfectNumber gives perfect number:

If p is a Mersenne prime exponent, then is a perfect number:

Every even perfect number has the form , where p is a Mersenne prime exponent:

Check that in the representation above p is 5:

Triangular numbers of Mersenne primes are perfect numbers:

Hexagonal numbers related to Mersenne prime exponents are perfect numbers:

Use DivisorSigma to test whether a positive integer is perfect:

Possible Issues  (3)

Expressions that represent perfect numbers but do not evaluate explicitly will give False:

It is necessary to use symbolic simplification first:

More perfect numbers are known, but their ranking is still unknown:

Introduced in 2016
 (10.4)