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