#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double a[100010];
  double b[100010];
  while (~scanf("%d%d", &n, &m)) {
    memset(b, 0, sizeof(b));
    double t = 0;
    for (int i = 1; i <= n; i++) {
      b[i] = pow(i * 1.0 / n, m);
      b[i] = b[i] - t;
      t += b[i];
    }
    double E = 0;
    for (int i = 1; i <= n; i++) E += b[i] * i;
    printf("%.12lf\n", E);
  }
}
