#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, m;
double f[maxn], ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    f[i] = pow(i * 1.0 / n, m) - pow((i - 1) * 1.0 / n, m);
    ans += f[i] * i;
  }
  printf("%.10lf", ans);
}
