#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 2e9;
const long long INFLL = 1e18;
const int MAX_N = 100000;
const double MAX_K = 1e-9;
double d;
int N, M;
double multi(double x, int y) {
  if (y == 1) return x;
  double m = multi(x, y / 2);
  if (y % 2) {
    return m * m * x;
  }
  return m * m;
}
double dp[MAX_N + 1];
double ans;
int main() {
  cin >> M >> N;
  for (int i = 1; i <= M; i++) {
    dp[i] = multi((double)i / (double)M, N);
    ans += (double)i * (dp[i] - dp[i - 1]);
  }
  cout << ans;
  return 0;
}
