Coprimes: Difference between revisions

334 bytes added ,  3 years ago
Realize in F#
(added AWK)
(Realize in F#)
Line 440:
end loop;</lang>
 
=={{header|F_Sharp|F#}}==
<lang fsharp>
// Coprimes. Nigel Galloway: May 4th., 2021
let rec fN g=function 0->g=1 |n->fN n (g%n)
[(21,15);(17,23);(36,12);(18,29);(60,15)] |> List.filter(fun(n,g)->fN n g)|>List.iter(fun(n,g)->printfn "%d and %d are coprime" n g)
</lang>
{{out}}
<pre>
17 and 23 are coprime
18 and 29 are coprime
</pre>
=={{header|Factor}}==
{{works with|Factor|0.98}}
2,172

edits