#include <bits/stdc++.h>
using namespace std;
long double power(long double x, long long n) {
  long double res = 1;
  while (n) {
    if (n & 1) res *= x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
int main() {
  long long n, i;
  long double last, ev, nw, m;
  cin >> m >> n;
  ev = last = power(1.0 / m, n);
  for (i = 2; i <= (long long)m; i++) {
    nw = power(i / m, n);
    ev += i * (nw - last);
    last = nw;
  }
  printf("%.9Lf\n", ev);
  return 0;
}
