#include <bits/stdc++.h>
using namespace std;
double m;
int n;
double mcpower(double a, int u) {
  double ans = 1;
  while (u) {
    if (u & 1) ans *= a;
    a *= a;
    u >>= 1;
  }
  return ans;
}
int main() {
  while (cin >> m >> n) {
    double ans = 0;
    for (int i = 1; i <= m; i++)
      ans += i * (mcpower(1.0 * i / (1.0 * m), n) -
                  mcpower(1.0 * (i - 1) / (1.0 * m), n));
    printf("%.12f\n", ans);
  }
  return 0;
}
