#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int infi = 1e9;
const long long Linfi = (long long)9e18;
const long long MOD = 1000000007;
const int c1 = 31;
int n, m;
double power(double a, int p) {
  if (p == 0) return 1;
  if (p == 1) return a;
  double ans = power(a, p / 2);
  ans = ans * ans;
  if (p % 2 == 1) ans = ans * a;
  return ans;
}
void solve() {
  double ans = 0;
  for (int i = 1; i <= m; i++) {
    double t1 = 1.0 * (i) / (1.0 * m);
    double t2 = 1.0 * (i - 1) / (1.0 * m);
    ans += 1.0 * i * (power(t1, n) - power(t2, n));
  }
  printf("%.4lf\n", ans);
}
int main() {
  cin >> m >> n;
  solve();
  return 0;
}
