#include <bits/stdc++.h>
using namespace std;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
const long double PI = 3.1415926535897932384626;
const long long int MAX = 1000000000 + 7;
int main() {
  long long int m, n;
  cin >> m >> n;
  double sum = m;
  for (long long int i = 1; i < m; i++) {
    sum -= pow((double)i / m, n);
  }
  cout << fixed << setprecision(10) << sum << endl;
  return 0;
}
