Source: https://mathematiques.lmrl.lu/Exercices/Exercices_de_6e/6-ch3-nombres_premiers.pdf