#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  double x = m;
  double y, yx, yxs = 0.0;
  for (int i = 1; i < m; i++) {
    y = double(i) / double(m);
    yx = pow(y, n);
    yxs += yx;
  }
  printf("%0.8f", x - yxs);
}
