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