#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  long double sol = 0;
  for (int i = 1; i <= m; ++i) {
    sol += i * powl(1.L * i / m, n);
    sol -= i * powl(1.L * (i - 1) / m, n);
  }
  cout << sol << '\n';
}
