Coprimes: Difference between revisions

m
(→‎{{header|Raku}}: Add a Raku entry)
Line 35:
 
=={{header|Raku}}==
How do you determine if numbers are co-prime? Check to see if the [[Greatest common divisor]] is equal to one. SoSince justwe're duplicating tasks willy-nilly, lift code from [[Greatest_common_divisor#Raku|that task]], (or in this case, just use the builtin).
 
<lang perl6>say .raku, ( [gcd] |$_ ) == 1 ?? ' Coprime' !! '' for [21,15],[17,23],[36,12],[18,29],[60,15]</lang>
10,333

edits