#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  int i;
  cin >> m >> n;
  double p[m];
  double pre[m];
  p[0] = pow(1.0 / m, n);
  pre[0] = p[0];
  for (i = 1; i < m; i++) {
    p[i] = pow(double(i + 1) / m, n) - pre[i - 1];
    pre[i] = pre[i - 1] + p[i];
  }
  double a = 0;
  for (int k = 1; k <= m; k++) {
    a += k * p[k - 1];
  }
  cout << a << endl;
  return 0;
}
