#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 10;
const int MOD = 1000 * 1000 * 1000 + 7;
long double n, m;
long double Pow(long double a, int b) {
  if (b == 0) return 1;
  long double x = Pow(a, b / 2);
  x *= x;
  if (b % 2) x *= a;
  return x;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(10);
  cin >> m >> n;
  long double ans = 0;
  for (long double i = 1; i < m; i++) {
    ans += Pow(i / m, n);
  }
  cout << m - ans;
  return 0;
}
