#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //#include int p[1000008] = {}; int main() { int n; double a; cin >> n >> a; for (int i = 2; i <= n; i++) { for (int j = i; j <= n; j += i) { p[j]++; } //cout << i; } double w = 0; for (int i = 2; i <= n; i++) w += pow(1 - a, p[i] - 1); cout << w << endl; return 0; }