#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int maxn = 200200;
const int inf = 1000000007;
const int mod = 1000000007;
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
double pr[maxn];
double pw(double x, int k) {
  if (k == 1) return x;
  double ans = pw(x, k / 2);
  ans = ans * ans;
  if (k % 2 == 1) ans = ans * x;
  return ans;
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    pr[n + 1] = 0;
    double ans = 0;
    for (int i = n; i >= 1; i--) {
      pr[i] = 1 - pw((double)(i - 1) / n, m);
      ans += i * (pr[i] - pr[i + 1]);
    }
    printf("%.10lf\n", ans);
  }
  return 0;
}
