from math import *
def seuil():
    N=0
    U=3
    while ... :
        N=N+1
        U=...
    return ...