#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
vector<long long> g[100005];
vector<bool> vis(100005, 0);
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long m, n;
  cin >> m >> n;
  double ans = 0.0;
  for (long long i = 1; i <= m; i++) {
    ans += (pow(i / ((1.0) * m), n) - pow((i - 1) / ((1.0) * m), n)) * i;
  }
  cout << setprecision(10) << ans;
}
