#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
T1 mypow(T1 b, T2 p) {
  if (p == 1)
    return b;
  else if (p == 0)
    return 1;
  T1 x = mypow(b, p / 2);
  if (p % 2 == 0)
    return x * x;
  else
    return x * x * b;
}
double M, N;
double calc(double M) {
  double sum = 0;
  for (int i = 1; i < M; ++i) {
    sum += pow(i / M, (int)N);
  }
  return sum;
}
int main() {
  cin >> M >> N;
  double ans = M - calc(M);
  cout << ans << endl;
  return 0;
}
