euler/ruby/euler047.rb

6 lines
151 B
Ruby
Raw Permalink Normal View History

2014-11-19 22:50:42 +00:00
require 'prime'
def solution_up_to(n)
(1..n).map { |x| Prime.prime_division(x).count }.each_cons(4).find_index { |x| x.all? { |y| y == 4} } + 1
end