#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
struct __isoff {
  __isoff() {
    if (0) freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    srand(time(0));
  }
  ~__isoff() {}
} __osafwf;
const unsigned long long p1 = 131797;
const unsigned long long p2 = 435493969;
const double eps = 1e-9;
const double pi = acos(-1.0);
const long long inf = 1e18 + 7;
const long long infi = 1e9 + 7;
const double infd = 23e30 + 7;
const long long dd = 5e3 + 7;
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> m >> n;
  double res = 0;
  for (long long i = (long long)1; i < (long long)m + 1; i++)
    res += i * ((pow(i * 1.0 / m, n * 1.0) - pow((i - 1) * 1.0 / m, n * 1.0)));
  printf("%0.9f", res);
}
