Pythagorean quadruples: Difference between revisions

(→‎{{header|zkl}}: added code)
Line 255:
solution:=Data(max_number+1,Int).fill(0); # another byte array
foreach d in ([1..max_number]){
if(solution[ d ]) continue; # lots of solutionssolution overlap
d2 := d * d;
foreach c in ([1..d-1]){
if(solution[ d ]) continue; # lots of solutions
diff2 := d2 - ( c * c );
if(sum_of_two_squares[ diff2 ]) solution[ d ] = True;
Anonymous user