003 Largest prime factor.sf 299 B

123456789101112131415
  1. #!/usr/bin/ruby
  2. # Author: Daniel "Trizen" Șuteu
  3. # License: GPLv3
  4. # Website: https://github.com/trizen
  5. # The prime factors of 13195 are 5, 7, 13 and 29.
  6. # What is the largest prime factor of the number 600851475143 ?
  7. # https://projecteuler.net/problem=3
  8. # Runtime: 0.128s
  9. say gpf(600851475143)