#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  double ans = 0.0, t, t1, t2;
  for (int i = 1; i <= m; i++) {
    t1 = (double)1.0 * i / m;
    t2 = (double)1.0 * (i - 1) / m;
    t = pow(t1, n) - pow(t2, n);
    ans += (double)i * t;
  }
  printf("%.12f\n", ans);
}
