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