#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const long long in = 2147483648;
const long long maxn = 1e6 + 10;
const double e = exp(1);
const double pi = 2.0 * asin(1);
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  double n, m;
  scanf("%lf%lf", &n, &m);
  double ans = 0;
  double p = pow(n, m);
  for (int i = n; i >= 1; i--) {
    ans += i * (pow(i / n, m) - pow((i - 1) / n, m));
  }
  printf("%.12lf\n", ans);
  return 0;
}
