#include <bits/stdc++.h>
using namespace std;
long double solve(int n, int m) {
  long double nn = n;
  long double mm = m;
  long double ret = 0.0;
  for (int i = 1.0; i <= n; i++) {
    long double ii = i;
    long double tmp = pow(ii / nn, mm) - pow((ii - 1.0) / nn, mm);
    ret += tmp * (long double)i;
  }
  return ret;
}
int main() {
  int n, m;
  cin >> n >> m;
  cout << solve(n, m);
}
