#include <bits/stdc++.h>
using namespace std;
struct __s {
  __s() {}
  ~__s() {
    long long n;
    cin >> n;
  }
} __S;
double mm, back, now, ans;
long long m, n;
double st(double x) {
  double res = 1.0;
  for (long long i = 0; i < (long long)(n - 1); i++) {
    res *= x / m;
  }
  return res;
}
int main(void) {
  cin >> m >> n;
  mm = (double)m;
  back = st(mm);
  for (long long i = 0; i < (long long)(m); i++) {
    mm -= 1.0;
    now = st(mm);
    double res = (mm + 1.0) * (back + (back - now) * mm) / m;
    ans += res;
    if (res < 1e-6) {
      cerr << i << '\n';
      break;
    }
    back = now;
  }
  printf("%.10f \n", ans);
  return 0;
}
