Featured; Perfect numbers

16 Jun 2022

Introduction

I recently came across perfect numbers in a coding challenge and the topic fascinated me. So I thought to dedicate a blog to these perfect numbers.

A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number.

The Euclid–Euler theorem is a theorem in number theory that relates perfect numbers to Mersenne primes. It states that an even number is perfect if and only if it has the form \(2^{p−1} * (2p − 1)\), where \(2p − 1\) is a prime number. The theorem is named after mathematicians Euclid and Leonhard Euler, who respectively proved the “if” and “only if” aspects of the theorem.

Sufficiency proof

Necessity Proof