#include <bits/stdc++.h>
using namespace std;
long double fast_pow(long double a, long long k) {
  long double r = 1;
  while (k) {
    if (k & 1) r *= a;
    k >>= 1;
    if (k) a *= a;
  }
  return r;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long double m, n;
  cin >> m >> n;
  long double ans = 0;
  for (long double i = 1; i < m + 1; i++) {
    long double temp1 = fast_pow(i / m, n);
    long double temp2 = fast_pow((i - 1) / m, n);
    ans += ((temp1 - temp2) * i);
  }
  cout << setprecision(12) << ans << '\n';
  return 0;
}
