#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, -1, 0, 1, 1, -1, -1, 1};
int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dx1[] = {0, 1, 1}, dx2[] = {0, 1, 1}, dy1[] = {1, 1, 0},
    dy2[] = {-1, -1, 0};
int m, n;
double res;
double pow(double a, int mu) {
  if (mu == 0) return 1;
  double k = pow(a, mu >> 1);
  k *= k;
  if (mu & 1) return k * a;
  return k;
}
int main() {
  cin >> m >> n;
  res = m;
  for (int i = 1; i < m; i++) res -= pow(1.0 * i / m, n);
  printf("%.5f", res);
}
