#include <bits/stdc++.h>
using namespace std;
int cnt[11111];
int main() {
  int m, n;
  cin >> m >> n;
  double ans = m;
  for (int i = 1; i < m; ++i) {
    double c = pow(i * 1.0 / m, n);
    ans -= (c);
  }
  cout << ans;
  return 0;
}
