#include <bits/stdc++.h>
using namespace std;
int m, n;
double ans, now, pre;
int main() {
  while (~scanf("%d%d", &m, &n)) {
    ans = 0;
    pre = 0;
    for (int i = 1; i <= m; i++) {
      now = pow((double(i) / double(m)), double(n));
      ans += (now - pre) * i;
      pre = now;
    }
    printf("%.4lf\n", ans);
  }
  return 0;
}
