#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
const int MOD = 1e6 + 3;
long double step(long double k, int m) {
  if (m == 1) return k;
  if (m % 2 == 1) return step(k, m - 1) * k;
  long double p = step(k, m / 2);
  return p * p;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> m >> n;
  long double ans = 0;
  for (int i = 1; i <= m; i++) {
    ans += (step((long double)i / (long double)m, n) -
            step((long double)(i - 1) / (long double)m, n)) *
           (long double)i;
  }
  cout.precision(10);
  cout << fixed;
  cout << ans << endl;
}
