#include <bits/stdc++.h>
int main() {
  int i, n, m;
  scanf("%d%d", &m, &n);
  float sum = 0, x, y;
  for (i = 1; i <= m; i++) {
    x = (float)i / m;
    y = (float)(i - 1) / m;
    sum += i * (pow(x, n) - pow(y, n));
  }
  printf("%f\n", sum);
}
