#include <bits/stdc++.h>
using namespace std;
int n;
double powTab[100009];
double modPow(double n, int k) {
  double r = 1;
  while (k) {
    if (k & 1) {
      r = (r * n);
    }
    n = (n * n);
    k >>= 1;
  }
  return r;
}
int main(int argc, char const *argv[]) {
  int m;
  scanf("%d%d", &m, &n);
  double ans = 0;
  for (int i = 1; i <= m; i++) {
    ans +=
        (double)i * (modPow(i / (double)m, n) - modPow((i - 1) / (double)m, n));
  }
  printf("%.9lf\n", ans);
  return 0;
}
