#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, n;
  cin >> m >> n;
  double sol = 0.0;
  for (int i = 1; i <= m; i++) {
    sol += (i * (pow((i / m), n) - pow(((i - 1) / m), n)));
  }
  printf("%.12f\n", sol);
  return 0;
}
