#include <bits/stdc++.h>
using namespace std;
int main() {
  long double n;
  int m;
  cin >> n >> m;
  long sum = n;
  long double newsum = 0.0;
  for (int i = 0; i < n; i++) {
    newsum += pow((long double)i / (long double)n, m);
  }
  cout << sum - newsum;
}
