#include <bits/stdc++.h>
using namespace std;
int main() {
  long int i, m, n;
  double add, ans, t1, t2;
  scanf("%ld%ld", &m, &n);
  for (i = 1; i <= m; i++) {
    t1 = (double)i / m;
    t2 = (double)(i - 1) / m;
    add = i * (pow(t1, n) - pow(t2, n));
    ans += add;
  }
  printf("%.7lf", ans);
  return 0;
}
