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