#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 29;
int M, N;
int main() {
  scanf("%d%d", &M, &N);
  double dieExp = 0;
  for (int j = 0; j < (M); ++j) {
    double r = ((double)j / M) / ((double)(j + 1) / M);
    double a = (j + 1) * pow((double)(j + 1) / M, N - 1);
    dieExp += a * (1 - pow(r, N)) / (1 - r);
  }
  printf("%lf\n", dieExp / M);
  return 0;
}
