#include <bits/stdc++.h>
using namespace std;
long long n, m;
double ans, dp[200000];
double prob;
double pw(double a, long b) {
  if (b == 0) return 1;
  if (b % 2) return a * pw(a, b - 1);
  return pw(a * a, b / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> m >> n;
  for (int mx = 1; mx <= m; mx += 1) {
    prob = 1.0;
    prob = pw(mx * 1.0 / m, n);
    dp[mx] = prob;
  }
  for (int i = 1; i <= m; i += 1) {
    ans += i * (dp[i] - dp[i - 1]);
  }
  cout.precision(12);
  cout << fixed << ans << endl;
  return 0;
}
