#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m >> n;
  double ans = 0, c = 0;
  for (int i = 1; i <= m; i++) {
    if (i == 1) {
      ans = exp(-n * log(m));
      continue;
    }
    ans += exp(log(i) + n * log(i) - n * log(m));
    c += exp(log(i) + n * log(i - 1) - n * log(m));
  }
  printf("%.10lf\n", ans - c);
  return 0;
}
