#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int m, n;
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; i++)
    ans +=
        i * (pow(double(i) / double(m), n) - pow(double(i - 1) / double(m), n));
  cout << ans << '\n';
  return 0;
}
