#include <bits/stdc++.h>
using namespace std;
int main() {
  long double m, n;
  cin >> m >> n;
  long double fsum = 0, sum = 0, ssum = 0;
  for (int i = 1; i <= m; ++i) {
    sum += (i * 1.00) * (pow((i * 1.00) / (m * 1.00), n) * 1.000 -
                         pow((i - 1) * 1.00 / (m * 1.00), n * 1.00) * 1.000);
  }
  cout << fixed << setprecision(10) << sum;
  return 0;
}
