#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int maxn = (int)2e5 + 5;
const long long mod = (int)1e9 + 7;
int n;
long double m;
long double qpow(long double b, int e) {
  if (!e) return 1;
  if (e & 1) return qpow(b, e - 1) * b;
  return qpow(b * b, e >> 1);
}
long double f(long double first) {
  return first * (qpow(first / m, n) - qpow((first - 1) / m, n));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(7);
  cin >> m >> n;
  long double ans = 0;
  for (int first = 1; first <= m; first++) ans += f(first);
  cout << ans;
  return 0;
}
