#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> m >> n;
  double exp = 0.0;
  for (int i = 1; i <= m; i++)
    exp += i * (pow((double)i * 1.0 / m, n) - pow((double)(i - 1) / m, n));
  printf("%.10lf\n", exp);
  return 0;
}
