#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  double o = 0;
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; ++i) o += pow((double)i / n, k);
  printf("%.12f\n", n - o);
}
