#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int inf = 0x3f3f3f3f;
double n, m;
int main(int argc, char* argv[]) {
  cin >> m >> n;
  double ans, last;
  for (double i = 1; i <= m; i++) {
    double tmp = pow(i / m, n);
    ans += i * (tmp - last);
    last = tmp;
  }
  printf("%.12lf\n", ans);
  return 0;
}
