Coprime triplets: Difference between revisions

(Added Go)
Line 13:
# iterative Greatest Common Divisor routine, returns the gcd of m and n #
PROC gcd = ( INT m, n )INT:
IF m = 0 THENBEGIN
n
ELSE
INT a := ABS m, b := ABS n;
WHILE b /= 0 DO
Line 23 ⟶ 21:
OD;
a
FIEND # gcd # ;
# returns an array of the coprime triplets up to n #
OP COPRIMETRIPLETS = ( INT n )[]INT:
3,032

edits