#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  int i = 0;
  double d = 0;
  for (i = 1; i <= m; i++) {
    d += (double)i *
         ((double)pow((double)i / m, n) - (double)pow((double)(i - 1) / m, n));
  }
  printf("%.11lf", d);
  return 0;
}
