#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
long long N, M;
double p;
double po(double p, long long m) {
  double res = 1.0;
  while (m) {
    if (m & 1) res *= p;
    p = p * p;
    m >>= 1;
  }
  return res;
}
signed main() {
  cin >> M >> N;
  p = 1.0 / M;
  double ans = 0;
  for (long long i = 1; i <= M; i++) {
    double q = po(p * i, N);
    q -= po(p * (i - 1), N);
    ans += q * i;
  }
  printf("%.20f\n", ans);
  return 0;
}
