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  (11)

Basic Applications  (3)

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  (7)

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:

Wolfram Research (2016), PerfectNumberQ, Wolfram Language function, https://reference.wolfram.com/language/ref/PerfectNumberQ.html (updated 2024).

Text

Wolfram Research (2016), PerfectNumberQ, Wolfram Language function, https://reference.wolfram.com/language/ref/PerfectNumberQ.html (updated 2024).

CMS

Wolfram Language. 2016. "PerfectNumberQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/PerfectNumberQ.html.

APA

Wolfram Language. (2016). PerfectNumberQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PerfectNumberQ.html

BibTeX

@misc{reference.wolfram_2024_perfectnumberq, author="Wolfram Research", title="{PerfectNumberQ}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/PerfectNumberQ.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_perfectnumberq, organization={Wolfram Research}, title={PerfectNumberQ}, year={2024}, url={https://reference.wolfram.com/language/ref/PerfectNumberQ.html}, note=[Accessed: 22-December-2024 ]}