#include <bits/stdc++.h>
double eps = 1e-9;
double cal(int x, int n, int m) {
  double tmp = 1;
  for (int i = 0; i < n; i++) {
    tmp *= (double)x / m;
    if (tmp < eps) return 0.0;
  }
  return tmp;
}
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  double tmp = 0.0;
  for (int i = m - 1; i >= 1; i--) tmp += cal(i, n, m);
  printf("%.9lf\n", m - tmp);
}
