#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, n;
  cin >> m >> n;
  double sum = 0;
  for (int i = 1; i <= m - 1; i++) {
    double x = i / m;
    sum = sum + pow(x, n);
  }
  double result = m - sum;
  std::cout << std::setprecision(9) << result;
}
