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