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