#include <bits/stdc++.h>
using namespace std;
int m, n;
double ksm(double x, int k) {
  double base = 1;
  while (k) {
    if (k & 1) base = base * x;
    x = x * x;
    k >>= 1;
  }
  return base;
}
int main() {
  cin >> m >> n;
  double da = 0;
  for (int i = 1; i <= m; i++) {
    da += i * (ksm(1.0 * i / m, n) - ksm(1.0 * (i - 1) / m, n));
  }
  printf("%.10lf", da);
  return 0;
}
