Source: http://informatique.lmrl.lu/Exercices/Exercices_recursivite.pdf