#include <bits/stdc++.h>
using namespace std;
double p;
double q[200000];
double pow(int x) {
  if (x == 1) return p;
  double s = pow(x / 2);
  if (x & 1 == 1)
    return s * s * p;
  else
    return s * s;
}
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  double ans = 0;
  double r = 0;
  for (int i = 1; i <= m; i++) {
    p = double(i) / double(m);
    q[i] = pow(n);
  }
  for (int i = 1; i <= m; i++) {
    ans += (q[i] - q[i - 1]) * i;
  }
  printf("%.8lf\n", ans);
  return 0;
}
