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