#include <bits/stdc++.h>
long long n, i, j, h, k, t, d;
long double a, m, b;
using namespace std;
long double pow(long double a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long double t = pow(a, b / 2);
  t = t * t;
  if (b % 2 == 0)
    return t;
  else
    return t * a;
}
int main() {
  cin >> m >> n;
  a = m;
  for (i = 1; i < m; i++) {
    b = i / m;
    a -= pow(b, n);
  }
  cout << a;
}
