#include <bits/stdc++.h>
using namespace std;
double ksm(double ds, int zs) {
  double fs = 1;
  while (zs) {
    if (zs & 1) fs *= ds;
    ds *= ds;
    zs >>= 1;
  }
  return fs;
}
double tu[100001];
int main() {
  int m, n;
  cin >> m >> n;
  for (int a = 1; a <= m; a++) {
    tu[a] = ksm(a / (double)m, n);
  }
  double ss = 0;
  for (int a = 1; a <= m; a++) {
    ss += a * (tu[a] - tu[a - 1]);
  }
  printf("%.9f", ss);
}
