#include <bits/stdc++.h>
using namespace std;
long double fastExp(long double b, int e) {
  long double a = 1;
  while (e) {
    if (e & 1) a *= b;
    b *= b;
    e >>= 1;
  }
  return a;
}
int main() {
  long double n, m;
  cin >> m >> n;
  long double ans = 0;
  for (long double i = 1; i <= m; i++) {
    ans += i * (fastExp(i / m, n) - fastExp((i - 1) / m, n));
  }
  cout << setprecision(12) << ans << endl;
}
