#include <bits/stdc++.h>
using namespace std;
inline double ksm(double x, long long y) {
  double res = 1;
  while (y) {
    if (y & 1) res = res * x;
    x = x * x;
    y >>= 1;
  }
  return res;
}
double n, m, ans;
signed main() {
  cin >> m >> n;
  for (double i = 1; i <= m; i++)
    ans += i * (ksm(i / m, n) - ksm((i - 1) / m, n));
  printf("%.12lf\n", ans);
}
