#include <bits/stdc++.h>
using namespace std;
double power(double x, int y) {
  double temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else {
    if (y > 0)
      return x * temp * temp;
    else
      return (temp * temp) / x;
  }
}
int main() {
  int n, m;
  cin >> m >> n;
  double ans = 0;
  double x;
  for (int i = 0; i < m; i++) {
    x = i;
    double y = (x + 1) / (double)m;
    x = x / (double)m;
    x = power(y, n) - power(x, n);
    ans = ans + x * (double)(i + 1);
  }
  cout << setprecision(12) << ans << endl;
  return 0;
}
