#include <bits/stdc++.h>
using namespace ::std;
double power(double base, long long int exponent) {
  if (exponent == 0) return 1.0;
  double ans = power(base, exponent / 2);
  ans = ans * ans;
  if (exponent & 1) ans *= (base);
  return ans;
}
int main() {
  long long int i, j, k;
  double temp, p, q, r, m, n;
  cin >> m >> n;
  temp = 0;
  for (i = 1; i < m; i++) {
    temp = temp + power(1.0 * i / m, (long long int)n);
  }
  printf("%0.14f\n", m - temp);
}
