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