#include <bits/stdc++.h>
using namespace std;
long long mod_exp(long long x, long long y, long long mm) {
  if (y == 0)
    return (1);
  else if (y % 2 == 0)
    return (mod_exp((x * x) % mm, y / 2, mm));
  else
    return ((x * mod_exp((x * x) % mm, (y - 1) / 2, mm)) % mm);
}
int binary_search(int array[], int n, int x) {
  int a = 0, b = n - 1;
  while (a <= b) {
    int k = (a + b) / 2;
    if (array[k] == x) {
      return k;
    }
    if (array[k] > x)
      b = k - 1;
    else
      a = k + 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  cin >> m >> n;
  double x = m;
  for (int i = 1; i < m; i++) {
    x -= pow((double)i / m, n);
  }
  cout << fixed << setprecision(15) << x << endl;
  return 0;
}
