Perfect Numbers
A positive integer n is called
perfect
if
=
For Example:
= 1 + 2 + 3 + 6 = 12 = 2 * 6 =
so 6 is perfect
The most recent record for the number of perfect numbers that has been found is 34. There hasn't been found an answer to the question of whether there are infinitely many perfect numbers.
Here is a program that finds perfect numbers up to a certain number j.
>
P:= proc(j) local n,S;
for n from 2 to j do
S:= sigma(n);
if S = 2*n
then print (n,"is perfect");
fi;
od;
end;
> P(10);
> P(10^2);
> P(10^3);
> P(10^4);
The time command gives us an idea of how long, in seconds, this computation takes for the given j.
> time(P(10^4));
>
All 34 perfect numbers that are known are even. In fact, No one has found an odd perfect number or shown that they don't exist.
Here is a program to find odd perfect numbers up to a certain number k:
>
OddP:= proc(k) local T,N,L;
T:=0;
for N from 1 to k by 2 do
if N mod 2 = 1 then
L:=sigma(N);
if L = 2*N then
print(N,"is odd perfect");
T:=T+1;fi;fi;
od;
if T < 1 then
print("No odd perfect up to",k);fi;
end;
> OddP(10^3);
> OddP(10^4);
> OddP(10^5);
>
All of the even perfect numbers correspond to the Mersenne primes.
Mersenne numbers
are of the form
=
where p is prime
If a Mersenne number
=
is a prime, then it is a
Mersenne prime
.
Examples:
= 3
= 7
= 31
= 127
= 8197
are all Mersenne primes, but
= 2047 = 23 * 89 is only a Mersenne number since it is composite.
We can compute Mersenne primes with Maple with the mersenne command or simply just M :
>
> mersenne(3);
> M(3);
Inputing a number into the parameters outputs
. The parameter must be a prime-inputing a composite number returns "false":
> M(4);
> M(16);
Inputing an argument as a list with one integer outputs the ith Mersenne prime:
> M([4]);
> M([7]);
Maple only does up to 33 Mersenne primes.
> length(M([33]));
The 33rd Mersenne prime has 258716 digits.
>
Suppose n =
where both p and
are prime - then n is perfect.
Proof: n =
where p and
are prime.
=
=
*
Since
is prime.
=
*
=(
) 2 *
= (
) 2 *
= 2 *
(
) = 2n
therefore, n is perfect
There exists a Theorem developed by both Eulid and Euler that states n is an even perfect number if and only if n =
(
) where
is a Mersenne prime.
We have proved one part of this theorem already. Now we must prove that even perfect numbers must be of the given form. Let n be an even perfect number and write it as
n =
q , with q odd
Since gcd(
, q) = 1, then
=
(since
-function is multiplicative)
= (
)
(by the definition of
-function)
By the definition of a perfect number, we must also have
=
= 2 *
q =
Setting these two sigma(n)'s equal to each other, and letting s(q) = sum of all proper divisors of q (sum of the divisors of q minus q itself) =
- q, we get
=
=
(s(q) + q)
(since
= s(q) + q)
Therefore,
q = s(q)(
)
Clearly this implies that some integer d = s(q) is a proper divisor of q. On the other hand, s(q) was the sum of all proper divisors of q (defined above), including d, so that there cannot be any other proper divisors besides d. But a number q with a single proper divisor d must be a prime so d must equal 1. So from the above equation of q, we can write q as
q =
and conclude that q is a Mersenne prime. Thus each even perfect number is of the form
(
)
where
is a Mersenne prime.
The fact that n =
(
) is perfect if p and
are prime was known to Euclid in
Elements
(Book IX) around 350
B.C.
The characterization of even perfect numbers is thanks to Euler sometime in the eighteenth century. Therefore, the full theorem took about 2000 years to prove.
Using this new information, we can update our old perfect number program so that it is more efficient.
>
Perfect:=proc(i) local n,S;
for n from 2 do
S:=(2^(n-1))*(2^n-1);
if S > i then break; fi;
if isprime(n)
then
if
isprime(2^n-1) then
print(S,"is perfect");
fi;fi;
od;
end;
> Perfect(10);
> Perfect(10^2);
> time(Perfect(100^50));
Recall that this last number is the time, in seconds, for the command Perfec t to execute this particular i.
>
A positive integer n is called
multiply-perfect
if
= k*n where
. The multiple k is called the
multiplicity
of the number. The largest known multiplicity is k=8. Here is a program that searches for multiply-perfect numbers up to a number m.
>
>
MultP:= proc(m) local n,S,k;
for n from 2 to m do
S:=sigma(n);
if (S mod n) = 0
then
if S/n > 2 then print (n,"has multiplicity", S/n );
fi; fi;
od;
end;
> MultP(10^3);
> MultP(10^5);
Examples of larger multiply-perfect numbers:
multiplicity 3 = 523776
multiplicity 5 = 14182439040
>