#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m, sum = 0.0;
  cin >> m >> n;
  for (int i = 1; i < m; i++) {
    sum += pow(i * 1.0 / m, n);
  }
  sum = m - sum;
  printf("%.12f", sum);
  return 0;
}
