lim = 10000 b = [] \\ A027750 for (m=1, oo, b=concat(b, divisors(m)); if (#b >= lim, break)); c = [] \\ A038566 for (m=1, oo, c=concat(c, select(n -> gcd(n, m)==1, [1..m])); if (#c >= lim, break)) for (n=1, lim, print (n " " gcd(b[n], c[n]))) quit