#include <bits/stdc++.h>
using namespace std;
long double binpow(long double a, int b, long double mod = 2e18) {
  long double ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  cin >> m >> n;
  long double d = 0;
  for (int i = 1; i < m; ++i) {
    d += binpow((long double)i / m, n);
  }
  d = m - d;
  cout << setprecision(15) << d << '\n';
  return 0;
}
