#include <bits/stdc++.h>
using namespace std;
long double func(long double x, long long int n) {
  if (n == 0) return 1;
  if (n % 2 == 0) return func(x * x, n / 2);
  return x * func(x * x, (n - 1) / 2);
}
int main() {
  long long int m, n;
  cin >> m >> n;
  long double ans = 0;
  for (long long int i = 1; i <= m; i++) {
    long double t1 = func((long double)i / (long double)m, n);
    long double t2 = func((long double)(i - 1) / (long double)m, n);
    ans += i * (t1 - t2);
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
