#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  double res = 0;
  for (int i = 1; i <= m; i++) {
    double ii = i;
    res += (pow(ii / m, n) - pow((ii - 1) / m, n)) * ii;
  }
  double r1 = res;
  printf("%.12lf\n", r1);
}
