parent
c544ffed81
commit
ce1fc224af
@ -0,0 +1,14 @@
|
||||
require "prime"
|
||||
|
||||
house = 1
|
||||
while true
|
||||
house += 1
|
||||
|
||||
factors = house.prime_division
|
||||
presents = factors.map {|f,x| (x+1).times.map {|i| f**i }.inject(:+) }.inject(:*)
|
||||
|
||||
if presents >= 3600000
|
||||
puts house
|
||||
exit
|
||||
end
|
||||
end
|
Loading…
Reference in new issue