#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  double exp = 0;
  for (int x = 1; x <= n; ++x) {
    double a = (double)x / n;
    double b = (double)(x - 1) / n;
    exp += x * (pow(a, m) - pow(b, m));
  }
  cout << fixed << setprecision(6) << exp << '\n';
  return 0;
}
