#include <bits/stdc++.h>
using namespace std;
int n, m;
long double pw(long double b, int p) {
  if (p == 0) return 1;
  if (p == 1) return b;
  if (p % 2 == 0) return pw(b * b, p / 2);
  return b * pw(b, p - 1);
}
double fun(int p) {
  long double t1 = 0, t2, t3;
  int i, j, k;
  for (i = 1; i < m; i++) {
    t2 = i;
    t2 /= m;
    t1 += pw(t2, p);
  }
  t2 = m;
  return t2 - t1;
}
int main() {
  int i, j, k;
  cin >> m >> n;
  printf("%.6f\n", fun(n));
  return 0;
}
