#include <bits/stdc++.h>
using namespace std;
int N, M, l;
double f[2][100010], s[100010], ans;
int main() {
  scanf("%d%d", &M, &N);
  f[0][1] = 1;
  for (int i = 1; i <= N; i++) {
    s[l - 1] = 0;
    for (int j = l; j <= M; j++) s[j] = s[j - 1] + f[(i - 1) & 1][j];
    for (int j = l; j <= M; j++) {
      f[i & 1][j] = f[(i - 1) & 1][j] * j / M;
      f[i & 1][j] += s[j - 1] / M;
    }
    for (; l < M && f[i & 1][l] * M < 1e-5; l++)
      ;
  }
  ans = 0;
  for (int i = 1; i <= M; i++) ans = ans + f[N & 1][i] * i;
  printf("%.8lf", ans);
}
