#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; double p; cin >> n >> p; // 1とその数以外の約数の数 vector d(n+1, 0); for(int i = 2; i <= n; i++){ for(int j = 2 * i; j <= n; j += i) d[j]++; } double ans = 0.0; for(int i = 2; i <= n; i++){ ans += pow(1.0 - p, d[i]); } cout << fixed << setprecision(10); cout << ans << endl; }