#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  double ans = 0.0;
  for (int i = 1; i <= m; ++i) {
    ans +=
        (double)i * (pow((i / (double)m), n) - pow(((i - 1) / (double)m), n));
  }
  printf("%.12lf\n", ans);
  return 0;
}
