#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  double m, n;
  cin >> m >> n;
  double e = 0;
  for (int k = 1; k <= m; ++k) e += k * (pow(k / m, n) - pow((k - 1) / m, n));
  printf("%.8f\n", e);
  return 0;
}
