#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  double res = 0, p = 0;
  n = min(n, 10000);
  for (int j = 1; j <= m; ++j)
    res += j * (pow(double(j) / m, n) - pow(double(j - 1) / m, n));
  printf("%.8lf\n", res);
  return 0;
}
