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