#include <vector>
#include <iostream>

using namespace std;

int main()
{
	int n;

	while (true)
	{
		cin >> n;

		if (n == 0) { break; }

		vector<vector<double> > dp(n, vector<double>(69, 0.0));

		dp[0][1] = 1.0;

		for (int i = 1; i < n; i++)
		{
			double t = 0.5;

			for (int j = 1; j < 69; j++)
			{
				dp[i][0] += dp[i - 1][j] * (1.0 - t); t *= 0.5;
			}

			t = 1.0;

			for (int j = 1; j < 69; j++)
			{
				dp[i][j] += dp[i - 1][j - 1] * t; t *= 0.5;
			}
		}

		double sum = 0;

		for (int i = 0; i < n; i++)
		{
			sum += (1 - dp[i][0]);
		}

		printf("%.49999f\n", sum);
	}

	return 0;
}