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