#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, EV = 0;
  int n;
  cin >> m >> n;
  for (double i = 1; i <= m; i++)
    EV += (pow(i / m, n) - pow((i - 1) / m, n)) * i;
  cout << fixed << setprecision(6) << EV;
}
