#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double PI = atan(1.0) * 4;
const int inf = 2147483647 / 2;
template <class T>
void chmin(T& t, T first) {
  if (first < t) t = first;
}
template <class T>
void chmax(T& t, T first) {
  if (first > t) t = first;
}
template <class T>
int sgn(T first) {
  return (first > eps) - (first < -eps);
}
double mypow(double p, int n) {
  double ret = 1.0;
  while (n) {
    if (n & 1) ret *= p;
    n >>= 1;
    p *= p;
  }
  return ret;
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    double sum = 0;
    for (int i = (1); i <= (int)(n); i++) {
      double t = (i + 0.0) / n;
      double tmp = mypow(t, m);
      t = (i - 1.0) / n;
      tmp -= mypow(t, m);
      sum += tmp * i;
    }
    printf("%.6f\n", sum);
  }
  return 0;
}
