#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (~scanf("%d%d", &m, &n)) {
    double ans = 0;
    for (int i = 1; i <= m; i++) {
      ans += 1.0 * i *
             (pow(1.0 * i / m, 1.0 * n) - pow(1.0 * (i - 1) / m, 1.0 * n));
    }
    cout << ans << endl;
  }
  return 0;
}
