let rec go p n =
if n = 1L then p
elif n % p = 0L then go p (n / p)
else go (p + 1L) n
go 2L 600851475143L
|> printfn "%d"