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