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