#include <bits/stdc++.h>
using namespace std;
int n, m;
long double p[100005];
long double denu;
int main(int argc, char **argv) {
  scanf("%d%d", &m, &n);
  long double ans = 0;
  fill(p, p + 100005, 0);
  denu = 1;
  for (int i = (1); i <= (int)(n); i++) {
    denu = denu / 1.0 / m;
  }
  ans += denu;
  for (int i = (1); i <= (int)(m); i++) {
    p[i] = pow(i / 1.0 / m, n);
  }
  for (int i = (2); i <= (int)(m); i++) {
    ans += (p[i] - p[i - 1]) * i;
  }
  cout << setprecision(12) << ans;
  return 0;
}
