#include <bits/stdc++.h>
using namespace std;
double power(double i, long long j) {
  if (j == 0) return 1.0;
  if (j == 1) return i;
  double ass = power(i, j / 2);
  if (j % 2 == 0) return ass * ass;
  return i * ass * ass;
}
int main() {
  long long n, m;
  scanf("%I64d%I64d", &n, &m);
  double x = 0;
  double y = (double)n;
  for (long long i = 1; i <= n - 1; i++) {
    x += power((double)i / n, m);
  }
  x = y - x;
  printf("%.10lf\n", x);
}
