#include <bits/stdc++.h>
int n, m;
inline double pow_m(double a, int n) {
  double ret = 1, tmp = a;
  while (n) {
    if (n & 1) ret = ret * tmp;
    tmp = tmp * tmp;
    n >>= 1;
  }
  return ret;
}
int main() {
  scanf("%d%d", &m, &n);
  double ans = 0;
  for (int i = 1; i <= m - 1; i++) ans += pow_m(i * 1.0 / m, n);
  ans = m - ans;
  printf("%f\n", ans);
  return 0;
}
