#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  long double sol = 0;
  for (long long i = 1; i <= N; i++)
    sol += 1.0 * (powl(1.0 * i / N, M) - powl(1.0 * (i - 1) / N, M)) * i;
  cout.precision(5);
  cout << fixed;
  cout << sol << '\n';
  return 0;
}
