#include <bits/stdc++.h>
using namespace std;
double power(double x, int n) {
  double ret = 1.0;
  while (n) {
    if (n & 1) ret *= x;
    x *= x;
    n /= 2;
  }
  return ret;
}
vector<double> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  double n, m;
  while (cin >> m >> n) {
    double ans = 0.0;
    for (int i = (1); i <= (m); i++) {
      ans += i * (power((double)i / m, n) - power((double)(i - 1) / m, n));
    }
    cout << fixed << setprecision(6) << ans << endl;
  }
  return 0;
}
