#include <bits/stdc++.h>
using namespace std;
int n, m;
double tot = 0;
double binPow(double x, int n) {
  double res = 1;
  while (n) {
    if (n & 1) res *= x;
    x *= x;
    n >>= 1;
  }
  return res;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= m; ++i) {
    tot += i * (binPow(i / (double)m, n) - binPow((i - 1) / (double)m, n));
  }
  cout << setprecision(12) << fixed << tot << endl;
  return 0;
}
