#include <bits/stdc++.h>
using namespace std;
void fastInOut() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
int main() {
  double m, n, total = 0.0;
  cin >> m >> n;
  for (double i = 1; i <= m; i++) {
    double temp = pow(i / m, n) - pow((i - 1) / m, n);
    temp *= i;
    total += temp;
  }
  cout << fixed << setprecision(12) << total;
}
