#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m, prob;
  cin >> m >> n;
  prob = m;
  for (double i = 1; i < m; i++) {
    prob -= pow(i / m, n);
  }
  printf("%0.9lf\n", prob);
  return 0;
}
