#include <bits/stdc++.h>
using namespace std;
long double n, m, ans, sum;
long double pow(long double x, int T) {
  long double xx = 1;
  for (; T; T >>= 1) {
    if (T & 1) xx = xx * x;
    x = x * x;
  }
  return xx;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= m; ++i)
    ans += pow((long double)i / m, n) *
           (pow(((long double)i - 1.0) / i, n) - 1.) /
           (((long double)(i)-1.) / (i)-1);
  double sum = ans;
  printf("%.8lf\n", sum);
  return 0;
}
