#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int inf = (int)(1e9);
const int N = 100005;
int n, m;
long double binpow(long double a, int n) {
  long double res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
int main() {
  cin >> m >> n;
  long double ans = m;
  long double dop;
  for (int i = 1; i < m; ++i) {
    dop = (long double)(m - i) / m;
    ans -= binpow(dop, n);
  }
  printf("%.9lf", (double)ans);
  return 0;
}
