Quotient = "142857" N = gets.chomp.to_i n = N / Quotient.size rem = N % Quotient.size if N == 0 then puts 0 else puts "0." + Quotient*n + Quotient[0, rem] end