#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(0));
const double eps = 1e-10;
const long long N = 2e5 + 7;
const long long MOD = 1e9 + 7;
long double pw(long double b, long long p) {
  long double res = 1.0;
  while (p > 0) {
    if (p & 1) res = res * b;
    b = b * b;
    p >>= 1;
  }
  return res;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long m, n;
  cin >> m >> n;
  long double ans = 0.;
  for (long long i = 1; i < m + 1; i++) {
    ans += 1.0 * i * (pw(1.0 * i / m, n) - pw((1.0 * (i - 1)) / m, n));
  }
  cout << fixed << setprecision(12) << ans;
  return 0;
}
