#include using namespace std; using ll=long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,K; cin>>K>>N; ll an=0; set D; set AN; for(ll z=1;z*z*K<=N;z++)D.insert(z*z*K); for(ll x=1;x*x*x*x*x*x<=N;x++){ ll X=x*x*x*x*x*x; for(ll y=1;y*y*y*y+X<=N;y++){ if(D.count(X+y*y*y*y))AN.insert(X+y*y*y*y); } } cout<