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