Pythagorean quadruples: Difference between revisions

Content deleted Content added
Robbie (talk | contribs)
Added a solution for D
CalmoSoft (talk | contribs)
No edit summary
Line 731: Line 731:
say substr($, 2) /*stick a fork in it, we're all done. */</lang>
say substr($, 2) /*stick a fork in it, we're all done. */</lang>
{{out|output|text=&nbsp; is the same as the 1<sup>st</sup> REXX version.}} <br><br>
{{out|output|text=&nbsp; is the same as the 1<sup>st</sup> REXX version.}} <br><br>

=={{header|Ring}}==
<lang ring>
# Project : Pythagorean quadruples
# Date : 2017/12/17
# Author : Gal Zsolt (~ CalmoSoft ~)
# Email : <calmosoft@gmail.com>

limit = 2200
pq = list(limit)
for n = 1 to limit
for m = 1 to limit
for p = 1 to limit
for x = 1 to limit
if pow(x,2) = pow(n,2) + pow(m,2) + pow(p,2)
pq[x] = 1
ok
next
next
next
next
pqstr = ""
for d = 1 to limit
if pq[d] = 0
pqstr = pqstr + d + " "
ok
next
see pqstr + nl
</lang>
Output:
<pre>
1 2 4 5 8 10 16 20 32 40 64 80 128 160 256 320 512 640 1024 1280 2048
</pre>


=={{header|zkl}}==
=={{header|zkl}}==