#include <bits/stdc++.h>
using namespace std;
long long binpow1(int a, int n) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
long double binpow(long double a, int n) {
  long double res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m, i;
  long double a, x = 0;
  cin >> m >> n;
  x += (binpow(1.0 / m, n));
  for (i = 2; i <= m; i++) {
    a = (long double)i - 1.0;
    x += (binpow((a + 1) / m, n) - binpow(a / m, n)) * i;
  }
  cout << setprecision(9) << x;
  return 0;
}
