#include <bits/stdc++.h>
const int MAXN = 2e5 + 15;
using namespace std;
void solve() {
  int n;
  long double m;
  cin >> m >> n;
  long double x = 0;
  for (int i = 1; i < m; i++) {
    long double t = (1.0 * i) / m;
    x += pow(t, n);
  }
  cout << m - x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cout << fixed << setprecision(12);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
    cout << "\n";
  }
  return 0;
}
