把每一个序列映射在二进制下
#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
ll n, k; cin >> n >> k;
ll res = 0;
for(int i = 0; i < 32; i ++ ){
if(k >> i & 1) res += ll(pow(n, i));
}
cout << res << endl;
return 0;
}