Artifact Content
Not logged in

Artifact 6328445c69b877f60b36ec147e9844aa6716e4ca


// Enumerate coprime pythagoras triangles

for(int m=1;; ++m)
for(int n=1; n<m; ++n) if(((m^n)&1) && gcd(m,n)==1)
{
	int a = m*m-n*n, b = 2*m*n, c = m*m+n*n;
	if(a>b) swap(a,b);
}