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