#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m;
  while (cin >> m >> n) {
    double res = 0;
    for (double i = 1; i <= m; i++) {
      res += i * (pow(i / m, n) - pow((i - 1) / m, n));
    }
    cout << res << endl;
  }
  return 0;
}
