function Power(x, n: real): real;
begin
Power := exp(n * ln(x));
end;
var
i, n, temp, sign: integer;
s, x: real;
begin
read(n, x);
s := 0;
temp := 4;
sign := -1;
for i := 1 to n do
begin
sign := sign * (-1);
temp := temp + 1;
s := s + sign * (temp + Power(x, Power(2, i))) / sqrt(temp + 1);
end;
writeln(s);
end.