#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, tot, flag;
double ans;
int main() {
  int i, j, t;
  while (~scanf("%d%d", &m, &n)) {
    ans = m;
    double fm = log(m * 1.0);
    for (i = 1; i < m; i++) {
      double tmp = exp(n * (log(i + 0.0) - fm));
      ans -= tmp;
    }
    printf("%.7f\n", ans);
  }
  return 0;
}
