#include <stdio.h>
#include <math.h>
#define K 1073741824

int main(void) {
	int c[64],d,i,j,m,s;
	double x,y[131072];
	for(i = 0;i <= 63;i++){
		c[i] = 0;
	}
	c[0] = K;
	for(i = 1;i <= 100000;i++){
		m = 0;
		for(j = 31;j >= 0;j--){
			x = x + ((c[j] / pow(2,j)) / K);
			s = c[j];
			c[j + 1] = s / pow(2,j);
			m += s - (s / pow(2,j));
		}
		c[0] = m;
		y[i] = x;
	}
	while(scanf("%d",&d) , d != 0){
		printf("%lf\n",y[d]);
	}
	return 0;
}