#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 4, M = N, inf = (int)1e9;
const long long mod = 1e9 + 7;
int fastAbs(int n) { return (n ^ (n >> 31)) - (n >> 31); }
long long multiply(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long add(long long a, long long b) {
  return ((a % mod) + (b % mod)) % mod;
}
long long sub(long long a, long long b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
int ans = INT_MAX;
map<pair<int, int>, int> mp;
const int dx[4] = {1, 0, 0, -1};
const int dy[4] = {0, -1, 1, 0};
long double power(long double x, int n) {
  if (n == 1) return 1.0 * x;
  long double ans = power(1.0 * x, n / 2);
  if (n % 2 == 0) return 1.0 * ans * ans;
  return 1.0 * ans * ans * x;
}
void solve() {
  int n, m;
  cin >> n >> m;
  long double val = 0;
  for (int i = 1; i <= n; i++) {
    long double j = i - 1;
    val += i * (pow(1.0 * i / n, m) - pow(1.0 * (i - 1) / n, m));
  }
  cout << fixed << setprecision(10) << 1.0 * val << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  while (q--) solve();
}
