Pythagorean quadruples: Difference between revisions

Content added Content deleted
Line 1,159: Line 1,159:
{{out}}
{{out}}
<pre>1 2 4 5 8 10 16 20 32 40 64 80 128 160 256 320 512 640 1024 1280 2048</pre>
<pre>1 2 4 5 8 10 16 20 32 40 64 80 128 160 256 320 512 640 1024 1280 2048</pre>

=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>max = 2200;
maxsq = max^2;
d = Range[max]^2;
Dynamic[{a, b, Length[d]}]
Do[
Do[
c = Range[1, Floor[(maxsq - a^2 - b^2)^(1/2)]];
dposs = a^2 + b^2 + c^2;
d = Complement[d, dposs]
,
{b, Floor[(maxsq - a^2)^(1/2)]}
]
,
{a, Floor[maxsq^(1/2)]}
]
Sqrt[d]</lang>
{{out}}
<pre>{1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256, 320, 512, 640, 1024, 1280, 2048}</pre>


=={{header|Modula-2}}==
=={{header|Modula-2}}==