#include <bits/stdc++.h>
int m, n, i;
double r, zn;
int main() {
  scanf("%d%d", &m, &n);
  zn = log(m) * n;
  for (i = 1; i <= m; i++) {
    r += exp(log(i) * n - zn) * i;
    r -= exp(log(i - 1) * n - zn) * i;
  }
  printf("%.6lf\n", r);
  return 0;
}
