#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m >> n;
  double ans = 0, d[m + 1];
  d[0] = 0;
  for (int i = 1; i <= m; ++i) {
    d[i] = pow((double)i / m, n) - d[i - 1];
    ans += i * (d[i]);
    d[i] += d[i - 1];
  }
  printf("%lf", ans);
  return 0;
}
