#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const double esp = 1e-6;
const int inf = 0x3f3f3f3f;
int main() {
  int N, M;
  cin >> M >> N;
  double ans = 1. * M;
  for (int i = 1; i <= M - 1; i++) ans -= pow(1.0 * i / M, N);
  printf("%.6f", ans);
  return 0;
}
