#include <bits/stdc++.h>
using namespace std;
const int MAXT = 610;
double f[2][MAXT];
inline int Min(int a, int b) { return a < b ? a : b; }
int main() {
  int N;
  double K;
  scanf("%d %lf", &N, &K);
  double p1 = 1.0 / K, p2;
  for (int i = N - 1, lim, c = i & 1; i >= 0; --i, c ^= 1) {
    lim = Min(600, i + 1);
    for (int t = 1; t <= lim; ++t) {
      p2 = 1.0 / (double)(t + 1);
      f[c][t] =
          p1 *
              (p2 * (f[c ^ 1][t + 1] + f[c ^ 1][t] * t + t * (t + 1) / 2 + t)) +
          (1.0 - p1) * (f[c ^ 1][t]);
    }
  }
  printf("%.10lf", f[0][1] * K);
  return 0;
}
