#include <bits/stdc++.h>
inline double pow(double x, int p) {
  double res = 1.00;
  for (; p; p >>= 1) {
    if (p & 1) res *= x;
    x *= x;
  }
  return res;
}
int main() {
  int m, n;
  double ans = 0.00;
  scanf("%d%d", &m, &n);
  for (register int i = 1; i <= m; ++i) {
    ans += (pow(i * 1.00 / m, n) - pow((i - 1) * 1.00 / m, n)) * i;
  }
  printf("%.4lf\n", ans);
  return 0;
}
