#include <bits/stdc++.h>
using namespace std;
double power(double a, int n) {
  if (n == 1) return a;
  if (n == 0) return 1;
  double p = power(a, n / 2);
  p *= p;
  if (n % 2) p *= a;
  return p;
}
int main() {
  int n;
  double m;
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; ++i) {
    double p = double(i) * (power(i / m, n) - power((i - 1) / m, n));
    ans += p;
  }
  printf("%.10f", ans);
  return 0;
}
