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