#include <bits/stdc++.h>
using namespace std;
void solve() {
  double m, n, sum = 0;
  cin >> m >> n;
  for (long long i = 0; i < m; i++) {
    sum += (pow((i + 1) / m, n) - pow(i / m, n)) * (i + 1);
  }
  cout << fixed << sum;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(5);
  solve();
  cerr << "\ntime taken : " << ((float)clock() / CLOCKS_PER_SEC) * 1000
       << " ms\n";
  return 0;
}
