Source: https://mcours.net/cours/pdf/info/Une_serie_des_Exercices_ALGORITHMIQUE.pdf