Project Euler

Problem #3

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Erlang: Running time = 0.14s
+%echo

+%prime_list

+%prime_iterator

+%factor

p3()->io:format("~w~n",[lists:last(factor(600851475143))]).

Ruby: Running time = 0.03s
+#PrimeList

+#factors

def p3
  puts factors(600851475143)[-1]
end

Scala: Running time = 0.26s
+//PrimeList

+//factor

def p3 {
  println(factor(600851475143L).last)
}