#include <bits/stdc++.h>
using namespace std;
int n, m;
long double ans, p, q;
long double solve() {
  if (m == 1) return 1.;
  ans = 0;
  p = m;
  q = n;
  for (int i = (int)(0); i < (int)(m); i++) {
    long double k = i + 1;
    ans += k * (pow(k / p, q) - pow(1. * i / p, q));
  }
  return ans;
}
void input() { cin >> m >> n; }
int main() {
  cin.sync_with_stdio(0);
  cout << fixed << setprecision(12);
  input();
  cout << solve() << endl;
  return 0;
}
