#include <bits/stdc++.h>
double cache[112345];
double power(double d, int k) {
  d = 1.0 * d;
  if (k == 0) return 1;
  if (k & 1) return d * (power(d, k - 1));
  double ret = power(d, k / 2);
  return ret * ret;
}
int main() {
  int n, m;
  double ans = 0;
  scanf("%d %d", &m, &n);
  for (int i = 1; i <= m; i++) {
    double d = (1.0 * i) / (1.0 * m);
    cache[i] = power(d, n);
  }
  for (int i = 1; i <= m; i++) ans += ((1.0 * i) * (cache[i] - cache[i - 1]));
  printf("%0.15Lf", ans);
  return 0;
}
