#include <bits/stdc++.h>
using namespace std;
void set(int& n, int first) { n = n | (1 << first); }
void reset(int& n, int first) { n = n & ~(1 << first); }
bool check(int n, int first) { return (bool)(n & (1 << first)); }
int main() {
  int m, n;
  while (scanf("%d%d", &m, &n) == 2) {
    double ans = 0;
    for (double i = 1; i <= m; i++) {
      ans += i * (pow(i / m, n) - pow((i - 1) / m, n));
    }
    printf("%0.9lf\n", ans);
  }
}
