Jump to content

Coprimes: Difference between revisions

401 bytes added ,  2 years ago
Added Arturo implementation
(Added Arturo implementation)
Line 277:
{{Out}}
<pre>{{17, 23}, {18, 29}}</pre>
=={{header|Arturo}}==
 
<lang rebol>coprimes?: function [a b] -> 1 = gcd @[a b]
 
loop [[21 15] [17 23] [36 12] [18 29] [60 15]] 'pair [
print [pair\0 "and" pair\1 "ara" (coprimes? pair\0 pair\1)? -> "coprimes." -> "not coprimes."]
]</lang>
 
{{out}}
 
<pre>21 and 15 ara not coprimes.
17 and 23 ara coprimes.
36 and 12 ara not coprimes.
18 and 29 ara coprimes.
60 and 15 ara not coprimes.</pre>
 
=={{header|AWK}}==
<lang AWK>
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.