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