#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  double f = 1.0 / (double)m, E = 0;
  for (int i = 1; i <= m; ++i) {
    E += i * (pow(i * f, n) - pow((i - 1) * f, n));
  }
  printf("%.4lf", E);
  return 0;
}
