#include <bits/stdc++.h>
using namespace std;
int m, n, i;
double o;
int main() {
  cin >> m >> n;
  for (i = 1; i <= m; i++)
    o += i * (pow((double)i / m, n) - pow((double)(i - 1) / m, n));
  cout << o << endl;
  return 0;
}
