#include <bits/stdc++.h>
using namespace std;
double quickpow(double m, int n) {
  double b = 1;
  while (n > 0) {
    if (n & 1) b *= m;
    n >>= 1;
    m *= m;
  }
  return b;
}
int main() {
  int i, j, m, n;
  double ans = 0, sum = 0;
  scanf("%d%d", &m, &n);
  for (i = 1; i <= m; i++) {
    double now = quickpow(1.0 * i / m, n);
    ans += i * (now - sum);
    sum += now - sum;
  }
  printf("%.6lf\n", ans);
  return 0;
}
