#include #include using namespace std; int main() { unsigned long long int a,b,c,m,n,ls = 0,s = 0; cin >> m >> n; for(int i = 2; i <= n; i++){ s += ls; ls = 0; for(a = 1; a <= m; a++){ for(int b = 1; b <= m; b++){ for(int c = 1; c <= m; c++){ if(a <= b && b <= c && c <= m && pow(a,i) + pow(b,i) == pow(c,i) ){ s += 1; ls += 1; } } } } } cout << s; return 0; }