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