#include <bits/stdc++.h>
using namespace std;
double quick_pow(double a, long long b) {
  double ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a);
    a = (a * a);
    b >>= 1;
  }
  return ret;
}
int main(void) {
  int m, n;
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; i++)
    ans +=
        1.0 * i * (quick_pow(1.0 * i / m, n) - quick_pow(1.0 * (i - 1) / m, n));
  printf("%.10lf\n", ans);
}
