#include <bits/stdc++.h>
using namespace std;
void solve() {
  int m, n;
  scanf("%d", &m);
  ;
  scanf("%d", &n);
  ;
  double x = m, y = m, z, temp = 0, sum = 0, ans = 0;
  x = 1 / x;
  y = 1 / y;
  for (int i = 1; i <= m; i++) {
    z = i;
    temp = pow(x, n);
    temp -= sum;
    sum += temp;
    ans = ans + z * temp;
    x += y;
  }
  printf("%.6lf\n", ans);
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
