#include <bits/stdc++.h>
using namespace std;
inline double qpow(double x, int exp) {
  double ret = 1;
  for (; exp; exp >>= 1) {
    if (exp & 1) ret *= x;
    x *= x;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  int m, n;
  cin >> m >> n;
  double ans = m;
  for (int i = 1; i < m; i++) ans -= qpow((double)i / m, n);
  cout << ans << endl;
  return 0;
}
