#include <bits/stdc++.h>
using namespace std;
const long long OO = 1LL << 60;
const long double dOO = (double)INT_MAX;
long long mod = 1000000007;
long double eps = 1e-6;
int main() {
  double n, m;
  scanf("%lf %lf", &m, &n);
  double ans = 0;
  int mm = m;
  for (int i = 1; i <= m; i++) {
    double cur = pow(1.0 * i / m, n) - pow((i - 1) / m, n);
    ans += cur * i;
  }
  printf("%.12f\n", ans);
}
