For this tutorial we will be considering three types of number prime numbers, mersenne prime and perfect numbers.

A
**Prime**
number is any number that is only divisible by itself and one. So examples of prime number are
$\left\{1,2,3,5,7,11...\right\}$

A
**Mersenne**
prime is a special type of prime number in that it is a prime number that can be written in the form of
${2}^{k}-1$. Example of the first few mersenne number are
$\left\{1,3,7,15,31,63,127,255...\right\}$

A
** Perfect**
numbers, on the other hand is, that which is equal to the sum of it parts. Put another way, a whole number is **perfect** if it is equal to the sum of its proper divisors. So for example the number 6 is perfect because it proper divisors are 1, 2, 3 and 1 + 2 + 3 = 6. So also are 28 (1 + 2 + 4 + 7 +14); 496 and 8128. There numbers constitute the first four perfect numbers and as is evident for the series there are *not* that many of them.

So what is the relationship between these numbers? From its definition it is clear that a mersenne prime is also a prime numbers. A consequence of this is, that k in the ${2}^{k}-1$ equation must also be prime. Also, a relationship between prime numbers and perfect numbers had been known since antiquity and formulated by Euclid in the following Theorem.

**Theorem. **
*If ${2}^{k}-1$ is prime and if
$N={2}^{k-1}\left({2}^{k}-1\right)$, then N is perfect.*

But it wasn't until almost 2000 year later that the exact relationship between these types of numbers was resolved by Euler in the following theorem.

**Theorem. **
*If N is an even perfect number, then
$N={2}^{k-1}\left({2}^{k}-1\right)$
, where
${2}^{k}-1$
is prime*

In plain language an even perfect number has a mesenne prime associated with it.

A mersenne prime then is a special type of prime number. In UML this is represented as an *'is a'* relationship *i.e.* A mersenne prime *is a* special type of prime number. Also since k in
${2}^{k}-1$
is also prime, then there is also an *'has a'* relationship *i.e.* A Mersenne number *has a* Prime number.

From Euler theorem on perfect numbers above it is clear that there are two types Odd Perfect numbers and Even Perfect numbers. Again this can be represented in UML as follows:

It is interesting to note that an odd perfect number has never been found even though some extraordinary properties about them are known, among which are:

- An odd perfect number cannot be divided by 105
- An odd perfect number must contain at least 8 different prime factors
- The smallest odd perfect number must exceed ${10}^{300}$
- The second largest prime factor of an odd number exceeds 1000
- The sum of the reciprocials of all odd perfect number id finite. Symbolically $\sum _{\mathrm{odd\; perfect}}\frac{1}{n}<\infty $

Look at item three on the list; imagine trying to do some long division sums in your head with that number

Finally, again from Eular theorem, perfect numbers are related to prime numbers in that an all even perfect number can be expressed in the form
$N={2}^{k-1}\left({2}^{k}-1\right)$
*i.e.*
$N={2}^{k-1}$
(a mersenne number). Therefore every even perfect number *has a* mersenne number. Once more in UML this can be diagrammatically depicted as follows: