#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
const int inf = 0x7fffffff;
long long a[N];
int main() {
  int n, m;
  while (cin >> m >> n) {
    double ans = m;
    for (int i = 1; i < m; i++) ans -= pow(1.0 * i / m, n);
    printf("%.12f\n", ans);
  }
  return 0;
}
