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