#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m, i, sum = 0;
  double ans;
  cin >> n >> m;
  cout.precision(7);
  for (i = 1; i <= n; i++) {
    sum += i * (pow(i / n, m) - pow((i - 1) / n, m));
  }
  cout << sum;
  return 0;
}
