#include <bits/stdc++.h>
using namespace std;
int n, m;
double ans[100010];
int main() {
  int i;
  while (scanf("%d%d", &m, &n) != EOF) {
    int nn;
    for (i = 1; i <= m; i++) {
      double temp = (double)i / (double)m;
      double hehe = 1;
      nn = n;
      int cnt = 0;
      while (nn) {
        if ((1 << cnt) & nn) {
          hehe *= temp;
          nn -= (1 << cnt);
        }
        temp *= temp;
        cnt++;
      }
      ans[i] = hehe;
    }
    double anss = 0;
    ans[0] = 0;
    for (i = 1; i <= m; i++) {
      anss += (ans[i] - ans[i - 1]) * i;
    }
    printf("%.12lf\n", anss);
  }
  return 0;
}
