#include <bits/stdc++.h>
using namespace std;
long double spow(double x, int n) {
  long double result = 1;
  while (n > 0) {
    if (n & 1) result *= (x);
    x *= x;
    n >>= 1;
  }
  return result;
}
int n, m;
int main() {
  double i;
  int j;
  scanf("%d%d", &m, &n);
  double ans = 0;
  double temp = 1;
  for (i = 1; i < m; ++i) {
    temp = 1;
    temp = spow(i / m, n);
    ans += temp;
  }
  printf("%.5lf\n", m - ans);
  return 0;
}
