#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 1e5 + 10, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int n, m;
double p[N];
double s[N];
double mul(double x, int tim) {
  double y = 1;
  while (tim) {
    if (tim & 1) y = y * x;
    x = x * x;
    tim >>= 1;
  }
  return y;
}
int main() {
  while (~scanf("%d%d", &m, &n)) {
    double ans = 0;
    for (int i = 1; i <= m; ++i) {
      double P = 1.0 * i / m;
      P = mul(P, n) - s[i - 1];
      ans += P * i;
      s[i] = s[i - 1] + P;
    }
    printf("%.15f\n", ans);
  }
  return 0;
}
