#include <bits/stdc++.h>
double a[100005], sum = 0;
int main() {
  memset(a, 0, sizeof(a));
  int m, n, i;
  double t = 0;
  scanf("%d%d", &m, &n);
  for (i = 1; i <= m; i++) {
    a[i] = pow(i * 1.0 / m, n);
    a[i] = a[i] - t;
    t = t + a[i];
  }
  for (i = 1; i <= m; i++) {
    sum = sum + i * a[i];
  }
  printf("%.12lf", sum);
}
