Largest prime factor

var n = 600851475143
 
say gpf(n)             #=> 6857
say factor(n).last     #=> 6857

Last updated