#include <bits/stdc++.h>
using namespace std;
double power(double x, int n) {
  double res = 1;
  for (int bit = 0; bit <= 30; ++bit) {
    if ((n >> bit) & 1) {
      res *= x;
    }
    x *= x;
  }
  return res;
}
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  double ans = 0;
  for (int i = 1; i <= m; ++i) {
    ans += i * (power((double)i / m, n) - power((double)(i - 1) / m, n));
  }
  printf("%.17lf\n", ans);
  return 0;
}
