#include <bits/stdc++.h>
using namespace std;
double ans, m;
int n;
double binpow(double a, int b) {
  if (b == 0)
    return 1;
  else if (b == 1)
    return a;
  else if (b % 2 == 0) {
    double t = binpow(a, b / 2);
    return t * t;
  } else
    return a * binpow(a, b - 1);
}
int main() {
  cin >> m >> n;
  for (double i = 1; i <= m; i++) {
    ans += i * binpow(i / m, n) * (1 - binpow((i - 1) / i, n));
  }
  cout << fixed << setprecision(15) << ans;
}
