#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 34;
const long long md = 1e9 + 7;
long double st(long double a, int step) {
  if (step == 0) return 1.0;
  if (step % 2 == 0) {
    long double q = st(a, step / 2);
    return q * q;
  }
  return a * st(a, step - 1);
}
int n, m;
long double p[N], sum;
int main() {
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    p[i] = st((i + 0.0) / (m + 0.0), n);
    p[i] -= p[i - 1];
    sum += p[i] * i;
    p[i] += p[i - 1];
  }
  cout.precision(10);
  cout << fixed << sum;
}
