#include <bits/stdc++.h>
using namespace std;
double a, b, n, m, sum, p;
int main() {
  cin >> m >> n;
  a = 1, b = 0, p = 0;
  for (int i = 1; i <= m; i++) {
    double k = pow(i / m, n);
    k = (k - p);
    sum += (k * i);
    p = p + k;
  }
  for (int i = 1; i <= n; i++) a *= m;
  double ans = sum / a;
  cout.precision(10);
  cout << fixed << sum;
  return 0;
}
