#include <bits/stdc++.h>
using namespace std;
double quick_pow(double a, int b) {
  double ans = 1, base = a;
  while (b != 0) {
    if (b & 1 != 0) ans *= base;
    base *= base;
    b >>= 1;
  }
  return ans;
}
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  double ans = 0;
  for (double i = 1; i <= m; i++) {
    ans += ((quick_pow(i / m, n) - quick_pow((i - 1) / m, n)) * i);
  }
  printf("%.12f", ans);
  return 0;
}
