#include <bits/stdc++.h>
using namespace std;
long long m, n;
long double sum;
long double pow(long double x, int num) {
  if (num == 1) return x;
  long double ans = pow(x, n / 2);
  if (num & 1) return ans * ans * x;
  return ans * ans;
}
int main() {
  cin >> m >> n;
  sum = m;
  for (int i = 1; i < m; ++i) sum -= pow((long double)i / m, n);
  cout << fixed << setprecision((5));
  cout << sum << "\n";
  return 0;
}
