#include <bits/stdc++.h>
using namespace std;
int n, m, j, i;
double ans, res;
double pow(double A, int B) {
  if (B == 0) return 1;
  double C = pow(A, B / 2);
  C *= C;
  if (B % 2) C *= A;
  return C;
}
int main() {
  cin >> m >> n;
  for (i = m - 1; i >= 1; i--) res -= pow((double)i / m, n);
  printf("%.15f\n", res + m);
}
