#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  long double n, m;
  cin >> m >> n;
  long double ans = 0;
  for (int i = 1; i <= m; i++) {
    long double p = powl(i / m, n) - powl((i - 1) / m, n);
    ans += p * i;
  }
  cout << setprecision(20) << ans << endl;
  return 0;
}
