#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  long double ans = 0, prev = 0;
  for (int x = 1; x <= m; x++) {
    long double t = pow(x / (0.0L + m), n);
    ans += x * (t - prev);
    prev = t;
  }
  cout << setprecision(10) << ans;
}
