#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.precision(9);
  cout.setf(ios::fixed);
  int m, n;
  cin >> m >> n;
  long double ans = m;
  for (int x = 1; x < m; ++x) {
    ans -= pow(double(x) / m, n);
  }
  cout << ans << endl;
}
