#include <bits/stdc++.h>
using namespace std;
signed n;
long double m, ans = 0;
long double qpow(long double a, signed b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long double res = qpow(a, b / 2);
  if (b % 2 == 1)
    return res * res * a;
  else
    return res * res;
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> m >> n;
  for (long double i = 1; i <= m; i++) {
    ans += qpow(i / m, n) * i;
    ans -= qpow((i - 1.0) / m, n) * i;
  }
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}
