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

int main(void) {
	int c[64],d,i,j,m,s;
	double x;
	while(scanf("%d",&d) , d != 0){
		x = 0;
		for(i = 0;i <= 63;i++){
			c[i] = 0;
		}
		c[0] = K;
		for(i = 1;i <= d;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;
		}
		printf("%lf\n",x);
	}
	return 0;
}