#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 7;
const int MXN = (int)2e5 + 10;
const double EPS = (double)1e-9;
double sum;
int n, k;
double binpow(int a) {
  double x = (double)a / n;
  double res = 1.0;
  int y = k;
  while (y) {
    if (y & 1) res *= x;
    x *= x;
    y >>= 1;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; ++i) {
    sum -= binpow(i);
  }
  sum += 1.0 * n;
  printf("%.9f", sum);
  return 0;
}
