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