#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int main() {
  int n, m;
  scanf("%d %d", &m, &n);
  double ans = 0.0;
  for (int i = 1; i <= m; ++i) {
    double a = pow((double)i / m, n), b = pow((double)(i - 1) / m, n);
    double cur = (a - b) * i;
    ans += (cur);
  }
  printf("%.12f\n", ans);
  return 0;
}
