#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iomanip>
#define MAX 100001
#define EPS (1e-2)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29) 
using namespace std;
double dp[MAX][10];
double pr[MAX];
double f[10];
int main()
{
  int n;
  
  f[0] = 1;
  REP(i,1,10)f[i] = f[i-1]/2;
  rep(i,MAX)rep(j,10)dp[i][j] = 0;
  dp[0][0] =  1;
  double sum = 0;

  REP(i,0,MAX-1)
    {
      rep(j,min(i+1,10))
	{
	  if(dp[i][j] == 0)continue;
	  if(j == 0)
	    {
	      dp[i+1][j+1] += dp[i][j];
	      sum += dp[i][j];
	      continue; 
	    }
	  dp[i+1][0]   += dp[i][j] * (1 - f[j]);
	  dp[i+1][j+1] += dp[i][j] * f[j];
	  sum += dp[i][j] * f[j];
	}      
      pr[i] = sum;
    }

  while(cin >> n,n)cout << setiosflags(ios::fixed) << setprecision(8) << pr[n-1] << endl;  
    
  
  return 0;
}