#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m;
  while (scanf("%lf%lf", &m, &n) != EOF) {
    double ans = 0;
    for (int i = 1; i <= m; i++) {
      ans += i * (pow(i * 1.0 / m, n) - pow((i - 1) * 1.0 / m, n));
    }
    printf("%0.10lf\n", ans);
  }
  return 0;
}
