#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> m >> n;
  double ans = 0;
  for (int k = 1; k <= m; k++)
    ans += k * (pow(double(k) / m, n) - pow(double(k - 1) / m, n));
  printf("%.12lf\n", ans);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
