#include <bits/stdc++.h>
int main() {
  int i;
  double n, m;
  while (scanf("%lf%lf", &m, &n) != EOF) {
    double a = 0, c = 0;
    for (i = 1; i <= m; i++) {
      double b = pow((double)(i) / m, n);
      a += (b - c) * i;
      c = b;
    }
    printf("%.12lf\n", a);
  }
  return 0;
}
