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