#include <bits/stdc++.h>
#pragma GCC optimize(2)
int n, m;
double P[100010];
double Qpow(double x, int p) {
  double ans = 1.0;
  while (p) {
    if (p & 1) ans = ans * x;
    x = x * x;
    p >>= 1;
  }
  return ans;
}
int main() {
  scanf("%d%d", &m, &n);
  double ans = 0.0;
  for (int i = 1; i <= m; i++) {
    P[i] = Qpow(1.0 * i / m, n) - Qpow(1.0 * (i - 1) / m, n);
  }
  for (int i = 1; i <= m; i++) {
    ans += 1.0 * i * P[i];
  }
  printf("%.10f\n", ans);
  return 0;
}
