4 $log = Logger
.new(STDERR)
5 $log.level
= Logger
::WARN
8 # The nth triangle number
13 def first_triangle_number_with_more_than_n_divisors(n
)
15 while triangle(i
).number_of_divisors
<= 500
16 $log.info
{ "Triangle number #{i} is #{triangle(i)}, which has #{triangle(i).number_of_divisors} divisors" }
19 $log.info
{ "Triangle number #{i} is #{triangle(i)}, which has #{triangle(i).number_of_divisors} divisors" }
24 puts
first_triangle_number_with_more_than_n_divisors(500)