#include <bits/stdc++.h>
using namespace std;
double n, m;
int main() {
  ios::sync_with_stdio(0), cin.tie();
  cin >> m >> n;
  double res = 0;
  for (int i = 1; i <= m; i++) {
    double x = pow((i / m), n);
    double y = pow((i - 1) / m, n);
    double w = (x - y) * i * 1.0;
    res += w;
  }
  cout << fixed << setprecision(5) << res;
  return 0;
}
