#include <bits/stdc++.h>
using namespace std;
long double pow1(long double a, int b) {
  long double res = 1.0;
  while (b != 0) {
    if (b & 1) res = (res * a);
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  cin >> m >> n;
  long double ans = 0.0;
  for (int i = 1; i <= m; i++) {
    long double val = pow1(((long double)i / (long double)m), n) -
                      pow1(((long double)(i - 1) / (long double)m), n);
    ans += ((long double)i * val);
  }
  cout << setprecision(10) << fixed << ans << "\n";
  return 0;
}
