#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
double getpow(double a, int b) {
  double ret = 1.0;
  while (b != 0) {
    if (b & 1) ret = ret * a;
    a = a * a;
    b = b >> 1;
  }
  return ret;
}
int main() {
  int n, m;
  cin >> m >> n;
  double ans = 0;
  double pre = getpow(((1.0) / (m)), n);
  ans = pre;
  for (int i = 2; i <= m; i++) {
    double cur = getpow((i * 1.0) / m, n);
    ans += (cur - pre) * i;
    pre = cur;
  }
  printf("%.5f\n", ans);
  return 0;
}
