#include <bits/stdc++.h>
double fast_exp(double base, int p) {
  if (p == 0) {
    return 1.0;
  }
  double a = fast_exp(base, p / 2);
  if (p & 1) {
    return a * a * base;
  } else {
    return a * a;
  }
}
int main(void) {
  int m, n;
  double r = 0;
  double sum = 0;
  double aux;
  scanf(" %d %d", &m, &n);
  for (int i = 1; i <= m; i++) {
    aux = fast_exp((1.0 * i) / m, n);
    r += i * (aux - sum);
    sum = aux;
  }
  printf("%.12lf\n", r);
  return 0;
}
