#include <bits/stdc++.h>
using namespace std;
int n, m;
long double binpow(long double a, long long 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 sum = 0;
  for (int i = 1; i <= m; ++i)
    sum += i * (binpow(i / (long double)m, n) -
                binpow((i - 1) / (long double)m, n));
  cout.precision(10);
  cout << fixed << sum << endl;
}
