#include <bits/stdc++.h>
using namespace std;
int i, j, k, n;
double m, ans;
double ksm(double x, int t) {
  double tmp1 = x, tmp2 = 1;
  int step = t;
  while (step > 0) {
    if (step % 2 == 1) tmp2 = tmp2 * tmp1;
    tmp1 = tmp1 * tmp1;
    step = step / 2;
  }
  return tmp2;
}
int main() {
  scanf("%lf %d", &m, &n);
  ans = 0;
  for (i = 1; i <= m; i++)
    ans = ans + i * ((ksm(i / m, n)) - (ksm((i - 1) / m, n)));
  printf("%.10lf", ans);
  return 0;
}
