def isqrt(n):1return int(floor(sqrt(n)))23def usqrt (n):4ur = isqrt(n)5if ur ** 2 < n:6ur = ur + 17return(ur)89def FermatAttack (n, rounds):10st = usqrt(n)11for x in range(st, st + rounds + 1):12sq = x ** 2 - n13y = isqrt(sq)14if y ** 2 == sq:15print("Factor found in round {0}".format( x - st + 1))16return(x + y)17print("No factors found in {0}".format( rounds))1819