#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double pi = 3.14159265358979323846;
const long long mxN = 2e5 + 2;
void _print(long long t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(double t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p);
template <class T>
void _print(vector<T> v);
template <class T>
void _print(set<T> v);
template <class T, class V>
void _print(map<T, V> v);
template <class T>
void _print(multiset<T> v);
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(set<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(multiset<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
double power(double a, long long b) {
  double ans = 1.0;
  while (b) {
    if (b & 1) {
      b--;
      ans = (ans * a);
    } else {
      b = b >> 1;
      a = (a * a);
    }
  }
  return ans;
}
void solve() {
  long long n, m;
  cin >> m >> n;
  double ans = 0.0;
  for (long long i = 1; i <= m; i++) {
    double a = (1.0 * i) / m;
    double b = (1.0 * (i - 1)) / m;
    ans += 1.0 * i * (power(a, n) - power(b, n));
  }
  printf("%6lf", ans);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
