#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long m, n;
  scanf("%lld %lld", &m, &n);
  double ans = 0;
  for (long long i = 1; i <= m - 1; i++)
    ans = ans + (pow((double)i / (double)m, (double)n));
  printf("%.4f", m * 1.0 - ans);
  return 0;
}
