EPS = 1e-16
ok = [0] * 100001
ng = [0] * 100001
div = [0] * 100001

ok[1] = 1.0
ng[1] = 0.0
div[1] = 1

(1..100000).each do |i|
  if div[i] > EPS
    div[i + 1] = div[i] * 2
  else
    div[i + 1] = div[i]
  end
end

(1..100000).each do |i|
  ok[i + 1] = ok[i] / div[i + 1] + ng[i]
  ng[i + 1] = 1 - ok[i + 1]
end
(1..100000).each do |i|
  ok[i + 1] += ok[i]
end

while n = gets.to_i
  break if n == 0
  printf "%.8f\n" % ok[n]
end