#include <bits/stdc++.h>
using namespace std;
int m, n;
double quick_power(double a, int b) {
  if (b == 0) return 1.0;
  if (b == 1) return a;
  double r = quick_power(a, b / 2);
  if (b % 2 == 1) return r * r * a;
  return r * r;
}
int main() {
  cin >> m >> n;
  double res = 0;
  for (int i = m; i >= 1; i--) {
    double tmp = (double)i / (double)m;
    double r1, r2;
    r1 = quick_power(tmp, n);
    tmp = (double)(i - 1) / (double)m;
    r2 = quick_power(tmp, n);
    res += (r1 - r2) * (double)i;
  }
  printf("%.8lf\n", res);
  return 0;
}
