#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const int N = 100100;
int n, m;
double res;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    res += i * (pow(i * 1.0 / n, m) - pow((i - 1) * 1.0 / n, m));
  printf("%.12lf\n", res);
}
