#include <bits/stdc++.h>
using namespace std;
int n, m;
long double bpow(double e, int p) {
  if (p == 0) return 1;
  if (p == 1) return e;
  long double t = bpow(e, p / 2);
  if (p % 2)
    return t * t * e;
  else
    return t * t;
}
long double mtr(int k, int n) {
  if (k == 1) return 1.0 / bpow(m, n);
  if (n == 1) return double(k) / m;
  if (n % 2)
    return double(k) / m * (bpow(double(k - 1) / m, n - 1) + mtr(k, n - 1));
  else
    return mtr(k, n / 2) *
           (bpow(double(k - 1) / m, n / 2) + bpow(double(k) / m, n / 2));
}
int main() {
  long double res = 0;
  cin >> m >> n;
  for (int i = 1; i <= m; i++) res += mtr(i, n);
  cout << fixed << setprecision(9) << res << endl;
}
