#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
double power(double x, int n) {
  if (n <= 1) return n ? x : 1;
  double t = power(x, n / 2);
  if (n % 2)
    return t * t * x;
  else
    return t * t;
}
double p[maxn];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= m; i++) p[i] = power(i * 1.0 / m, n);
  for (int i = m; i >= 1; i--) p[i] -= p[i - 1];
  double ans = 0;
  for (int i = 1; i <= m; i++) ans += i * p[i];
  printf("%.15f\n", ans);
}
