#include <bits/stdc++.h>
using namespace std;
int m, n;
int main(int argc, const char* argv[]) {
  cin >> m >> n;
  double result = 0.0, prev = 0.0;
  for (int i = 1; i <= m; ++i) {
    double curr = pow((double)i / (double)m, (double)n);
    result += (curr - prev) * i;
    prev = curr;
  }
  cout << result << endl;
  return 0;
}
