#include <bits/stdc++.h>
using namespace std;
double fastpow(double base, int what) {
  if (what == 0) return 1.0;
  if (what % 2 == 0) {
    double temp = fastpow(base, what / 2);
    return temp * temp;
  }
  return base * fastpow(base, what - 1);
}
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  double res = 0.0;
  int i;
  for (i = 1; i <= m; i++) {
    double expected = (double)i / (double)m;
    double expected2 = (double)(i - 1) / (double)m;
    res += (fastpow(expected, n) - fastpow(expected2, n)) * (double)i;
  }
  printf("%.6lf\n", res);
  return 0;
}
