#include <bits/stdc++.h>
double qp(double x, int n) {
  double ans = 1, base = x;
  while (n) {
    if (n & 1) ans *= x;
    x *= x;
    n >>= 1;
  }
  return ans;
}
int main() {
  double n, m, sum = 0;
  scanf("%lf%lf", &m, &n);
  for (int i = 1; i <= m; i++) {
    sum += (qp(i / m, n) - qp((i - 1) / m, n)) * i;
  }
  printf("%lf", sum);
  return 0;
}
