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