Coprimes: Difference between revisions

m
imported>Maxima enthusiast
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 624:
</pre>
 
 
=={{header|EasyLang}}==
<syntaxhighlight>
func gcd a b .
while b <> 0
h = b
b = a mod b
a = h
.
return a
.
proc test p[] . .
if gcd p[1] p[2] = 1
print p[]
.
.
pairs[][] = [ [ 21 15 ] [ 17 23 ] [ 36 12 ] [ 18 29 ] [ 60 15 ] ]
for i to len pairs[][]
test pairs[i][]
.
</syntaxhighlight>
{{out}}
<pre>
[ 17 23 ]
[ 18 29 ]
</pre>
 
=={{header|F_Sharp|F#}}==
Line 636 ⟶ 662:
18 and 29 are coprime
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.98}}
Line 1,273 ⟶ 1,300:
{{libheader|Wren-math}}
Two numbers are coprime if their GCD is 1.
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
 
var pairs = [[21,15],[17,23],[36,12],[18,29],[60,15]]
2,063

edits