#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INF64 = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-8;
const int MOD = 1000000007;
const int N = 2e6 + 10;
const int M = 1e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int m, n;
  cin >> m >> n;
  double ans = 0;
  for (int i = 1; i <= m; ++i) {
    ans += i * (pow(1.0 * i / m, n) - pow((i - 1.0) / m, n));
  }
  cout.precision(8);
  cout << fixed;
  cout << ans << '\n';
  return 0;
}
