#include <bits/stdc++.h>
using namespace std;
long double solve(int m, int n) {
  long double result = m;
  for (int i = m - 1; i >= 1; i--) {
    long double temp = ((long double)i) / m;
    result -= pow(temp, n);
  }
  return result;
}
int main() {
  int m, n;
  cin >> m >> n;
  cout << setprecision(10);
  cout << solve(m, n);
  return 0;
}
