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