#include <bits/stdc++.h>
using namespace std;
inline double pow(double x, int n) {
  if (n < 2) return n == 1 ? x : 1;
  return pow(x * x, n >> 1) * pow(x, n & 1);
}
inline double chanceOf(int val, int valMax, int times) {
  return pow((double)val / valMax, times) -
         pow((double)(val - 1) / valMax, times);
}
int main() {
  double exp = 0;
  int n, m;
  cin >> m >> n;
  for (int i = 1; i <= m; i++) exp += i * chanceOf(i, m, n);
  cout << exp << '\n';
  return 0;
}
