#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  double m, n, sum = 0.0;
  cin >> m >> n;
  cout << setprecision(4) << fixed;
  for (double i = (double)(1); i < (double)(m + 1); i++) {
    sum += i * (pow(i / m, n) - pow((i - 1) / m, n));
  }
  cout << sum << "\n";
}
