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