#include <bits/stdc++.h>
using namespace std;
long long n, m, ans = 0;
int main() {
  int m, n;
  cin >> m >> n;
  long double sum = m;
  for (int k = 1; k < m; k++) sum -= pow(1.0 * k / m, n);
  cout << sum << endl;
}
