#include <bits/stdc++.h>
using namespace std;
double exp(double a, int n) {
  if (n == 1) return a;
  double half = exp(a, n / 2);
  half *= half;
  if (n & 1) half *= a;
  return half;
}
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  double res = exp(1.0 / m, n);
  double pre = res;
  for (int i = 2; i <= m; i++) {
    double tep = exp(i * 1.0 / m, n);
    res += i * (tep - pre);
    pre = tep;
  }
  printf("%.6f\n", res);
  return 0;
}
