#include <bits/stdc++.h>
using namespace std;
bool check(int mask, int pos) { return (bool)(mask & (1 << pos)); };
void Set(int mask, int pos) { mask = (mask | (1 << pos)); };
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  double x = 0, res = 0.0;
  int n, m;
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    double tx = pow(1.0 * i / (double)m, n);
    res += (double)i * (tx - x);
    x = tx;
  }
  cout << fixed << setprecision(12);
  cout << res << endl;
  return 0;
}
