#erroneous, but accepted x = gets.to_f n = 100000 sum = 0 for i in 1 .. n sum += 1.0 / (x + i) / (x + i) end sum += 1.0 / (x + n + 0.5) p sum