#include <bits/stdc++.h>
using namespace std;
int M, N;
int main() {
  scanf("%d%d", &M, &N);
  double res = 0;
  for (int(i) = (1); (i) < (M + 1); (i)++)
    res += double(i) * (pow(double(i) / M, N) - pow(double(i - 1) / M, N));
  printf("%.81f\n", res);
}
