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