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