#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  long double sum = 0, cnt = 0, b = 0;
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    double e = i;
    sum += (pow(e / m, n) - b) * e;
    b = pow(e / m, n);
  }
  printf("%.7lf\n", (double)(sum + 0.0));
}
