#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const int N = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int n, m;
long double prob = 1;
long double fexp(long double b, int e) {
  long double ans = 1;
  while (e) {
    if (e & 1) ans = ans * b;
    b = b * b;
    e /= 2;
  }
  return ans;
}
int main() {
  scanf("%d %d", &m, &n);
  long double ans = 0;
  long double md = m;
  for (int i = 0; i < m; i++) {
    long double term1 = i;
    term1 = term1 / md;
    term1 = 1 - term1;
    term1 = fexp(term1, n);
    long double term2 = i + 1;
    term2 = term2 / md;
    term2 = 1 - term2;
    term2 = fexp(term2, n);
    long double term = term1 - term2;
    term = term * (md - (long double)i);
    ans += term;
  }
  printf("%.12Lf\n", ans);
  return 0;
}
