#include <bits/stdc++.h>
using namespace std;
double power(double x, int n) {
  if (n == 0) return 1.0;
  if (n == 1) return x;
  double t = power(x, n / 2);
  t = t * t;
  if (n % 2) return t * x;
  return t;
}
int main() {
  int m, n;
  cin >> m >> n;
  double ans = 0.0;
  for (int i = 1; i <= m; i++) {
    ans += i * (power(i / (double)m, n) - power((i - 1) / (double)m, n));
  }
  cout << fixed << setprecision(10);
  cout << ans << endl;
  return 0;
}
