#include <bits/stdc++.h>
using namespace std;
double pow_mod(double a, int n) {
  double ans = 1.;
  for (; n; n >>= 1) {
    if (n & 1) {
      ans *= a;
    }
    a *= a;
  }
  return ans;
}
void solve() {
  int m, n, i;
  double ans, tmp, p, p1;
  cin >> m >> n;
  ans = 0., p = 0.;
  for (i = m; i >= 1; i--) {
    tmp = pow_mod((i - 1.) / (m + 0.), n);
    p1 = 1. - p - tmp;
    ans += p1 * i;
    p += p1;
  }
  printf("%.12lf\n", ans);
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
