#include <bits/stdc++.h>
using namespace std;
double ans(0);
int n, m;
double qp(double x, int y) {
  double s = 1;
  while (y > 0) {
    if (y % 2 == 1) s = s * x;
    y = y >> 1;
    x = x * x;
  }
  return s;
}
int main() {
  scanf("%d%d", &m, &n);
  double mm = m;
  for (int i = m; i; --i) {
    ans += i * (qp(i / mm, n) - qp((i - 1) / mm, n));
  }
  printf("%.12lf", ans);
  return 0;
}
