#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  long double n, m;
  cin >> m >> n;
  long double ans = 0;
  for (long double i = 1; i <= m; i++)
    ans += i * pow(i / m, n) * (1 - pow((i - 1) / i, n));
  cout << fixed << setprecision(9) << ans << endl;
  return 0;
}
