I'm looking for some general feedback on my solution to Project Euler challenge 3
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?
let p3 () =
let rec primeFactors n i primes =
if i > n/2L then n::primes else
let quotient, remainder = Math.DivRem(n, i)
if remainder = 0L then primeFactors quotient 2L (i::primes)
else primeFactors n (i + 1L) primes
primeFactors 600851475143L 2L []
%
) \$\endgroup\$Math.DivRem
will return both the remainder and the quotient as a tuple in F#. \$\endgroup\$