#include <bits/stdc++.h>
using namespace std;
const int inf = 2e+9;
const int maxn = 2e+5 + 10;
const double e = 1e-8;
const int MOD = 1000000000 + 7;
long long n, m, k;
double binpow(long double a, long long k) {
  long long l = k;
  long double b = a;
  long double y = 1;
  while (l > 0) {
    if (l % 2 == 0) {
      b = b * b;
      l /= 2;
    } else {
      y = y * b;
      l -= 1;
    }
  }
  return y;
}
int main() {
  long long n, m, k;
  cin >> m >> n;
  long double ans = 0;
  for (int i = 2; i <= m; i++) {
    ans +=
        (binpow((long double)i / m, n) - binpow((long double)(i - 1) / m, n)) *
        (long double)i;
  }
  ans += binpow((long double)1 / m, n);
  cout.precision(6);
  cout << ans << '\n';
  return 0;
}
