#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> m >> n;
  double mm = m, nn = n;
  double sum = 0;
  for (int i = 1; i <= m; ++i) {
    double cur = i;
    sum += (cur * (pow(cur / mm, nn) - pow((cur - 1.0) / mm, nn)));
  }
  printf("%.10lf\n", sum);
  return 0;
}
