local n, p = io.read("*n", "*n") -- Lua 5.1 local function getyakusuu(x) local tmp = {} local lim = math.ceil(math.sqrt(x)) local dv = 2 while(1 < x and dv <= lim) do if(x % dv == 0) then tmp[dv] = 1 x = x / dv while(x % dv == 0) do x = x / dv tmp[dv] = tmp[dv] + 1 end end dv = dv + (dv == 2 and 1 or 2) end if(x ~= 1) then tmp[x] = 1 end local cnt = 1 for k, v in pairs(tmp) do cnt = cnt * (v + 1) end return cnt end local tot = 0 for i = 2, n do local z = getyakusuu(i) - 2 if(z == 0) then tot = tot + 1 else tot = tot + (1 - p)^z end end print(string.format("%.8f", tot))