#include <bits/stdc++.h>
using namespace std;
int n, m;
double p(double d, int k) {
  if (!k) {
    return 1.0;
  }
  if (k & 1) {
    return d * p(d, k - 1);
  }
  double ret = p(d, k / 2);
  return ret * ret;
}
int main() {
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; i++) {
    double p1 = p((double)i / m, n);
    int j = i - 1;
    double p2 = p((double)j / m, n);
    ans += i * (p1 - p2);
  }
  printf("%.6f\n", ans);
  return 0;
}
