#include <bits/stdc++.h>
using namespace std;
double f(double x, int n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    return f(x * x, n / 2);
  }
  if (n % 2 == 1) {
    return x * f(x * x, (n - 1) / 2);
  }
}
int main() {
  long long n, m;
  cin >> m >> n;
  double sum = 0.0;
  for (long long i = 1; i <= m; i++) {
    sum += (double)i *
           (f((double)i / (double)m, n) - f((double)(i - 1) / (double)m, n));
  }
  printf("%.12f", sum);
  return 0;
}
