@count = 20000 x = gets.to_i a = Rational(0,1) @count.times{|n| a+=Rational(1,(x+n+1)*(x+n+1)) } gosa = Rational(1,(x+@count-1)) p (a+gosa).to_f