#include <bits/stdc++.h>
double pow(double a, int m) {
  double tmp = 1;
  while (m) {
    if (m & 1) tmp = tmp * a;
    a = a * a;
    m >>= 1;
  }
  return tmp;
}
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  double sum = 0.0;
  for (int i = 1; i <= m - 1; ++i) {
    sum += pow(i / (double)m, n);
  }
  printf("%.12lf\n", m - sum);
}
