#include <bits/stdc++.h>
using namespace std;
double pw(double a, long long n) {
  double r = 1;
  for (long long i = 20; i >= 0; i--) {
    r *= r;
    if (n & (1LL << i)) r *= a;
  }
  return r;
}
long long n, m;
double prob(long long a) { return pw((a + 1) / double(m), n); }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> m >> n;
  double tsm = 0;
  double p, o;
  o = 0;
  for (long long i = 0; i < (m); ++i) {
    p = prob(i);
    tsm += (p - o) * (i + 1);
    o = p;
  }
  cout << setprecision(15);
  cout << tsm << endl;
  return 0;
}
