#include <bits/stdc++.h>
using namespace std;
double power(long long b, long long p) {
  double x = 1.0;
  for (int i = 1; i <= p; i++) {
    x = x * b;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  double n, m;
  while (cin >> m >> n) {
    double sum = 0;
    for (int i = 1; i <= (int)m; i++) {
      double x = pow(i / m, n);
      double y = pow((i - 1) / m, n);
      sum += i * (x - y);
    }
    cout.precision(10);
    cout << sum << endl;
  }
  return 0;
}
