#include <bits/stdc++.h>
using namespace std;
int main() {
  double ans, p, t;
  int n, m;
  while (scanf("%d%d", &m, &n) != EOF) {
    ans = p = t = 0;
    for (int i = 1; i <= m; i++) {
      p = pow(1.0 * i / m, n) - t;
      t += p;
      ans += p * i;
    }
    printf("%.7lf\n", ans);
  }
  return 0;
}
