#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double EPS = 0.0000001;
const double PI = 3.141592653589793;
const int MAX_N = 100002;
int N, M, K, P;
int v[MAX_N];
inline int double_cmp(double a, double b) {
  if (a - b < -EPS) return -1;
  if (a - b > EPS) return 1;
  return 0;
}
double expo(double a, int b) {
  double ret = 1;
  while (b) {
    if (b % 2) ret *= a;
    a *= a;
    b /= 2;
  }
  return ret;
}
int main() {
  cin >> M >> N;
  double exp = 0, temp = expo(M, N);
  for (int i = 1; i <= M; ++i) {
    double p1 = (double)i / M, p2 = (double)(i - 1) / M;
    p1 = expo(p1, N);
    p2 = expo(p2, N);
    exp += (p1 - p2) * i;
  }
  printf("%.9lf\n", exp);
  return 0;
}
