#include <bits/stdc++.h>
using namespace std;
double p[100010];
int main() {
  double m, n;
  cin >> m >> n;
  int i, j;
  double sum = 0;
  for (i = m; i > 0; --i) {
    p[i] = 1 - sum - pow((double)(i - 1) / m, n);
    sum += p[i];
  }
  double ans = 0;
  for (i = 1; i <= m; ++i) {
    ans += p[i] * i;
  }
  printf("%.12lf\n", ans);
  return 0;
}
