#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {}
int t, d, n, m, q, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  int TestCases = 1;
  while (TestCases--) {
    long double n, m, q;
    cin >> m >> n;
    q = m;
    for (long double i = 1.0; i <= m - 1; ++i) q -= pow(i / m, n);
    cout << q;
  }
  return 0;
}
