#include <bits/stdc++.h>
using namespace std;
long double n, m, res;
long double fastpow(long double x, int st) {
  if (st == 0) return (long double)1;
  if (st % 2 == 0) {
    long double t = fastpow(x, st / 2);
    return (t * t);
  }
  return (x * fastpow(x, st - 1));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    long double f = fastpow(i / m, n);
    long double l = fastpow((i - 1) / m, n);
    res += (i * (f - l));
  }
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}
