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