#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  double ans = (double)m;
  for (int i = 1; i < m; i++) {
    double temp = (double)(m - i) / (double)m;
    ans -= pow(temp, n);
  }
  cout << fixed << setprecision(15) << ans;
  return 0;
}
