#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, n;
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; i++) {
    ans += (pow(i / m, n) - pow((i - 1) / m, n)) * i;
  }
  cout << ans << endl;
}
