#include <bits/stdc++.h>
using namespace std;
int n;
double m;
double q_pow(double a, int b) {
  double ans = 1.0;
  while (b) {
    if (b % 2 == 1) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
int main() {
  scanf("%lf%d", &m, &n);
  double ans = m;
  for (double i = 1; i <= m - 1; i = i + 1) {
    ans -= q_pow((double)i / m, n);
  }
  printf("%.12f", ans);
  return 0;
}
