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