#include <bits/stdc++.h>
using namespace std;
double get_prob(int i, int m, int n) {
  return pow(i * 1.0 / m, n) - pow((i - 1) * 1.0 / m, n);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  int m, n;
  cin >> m >> n;
  double answer = 0;
  for (int i = 1; i <= m; ++i) answer += i * get_prob(i, m, n);
  cout << answer << endl;
  return 0;
}
