s = 0 unseen = 1 unseen odd = 1 seen(v) = bittest(s, v) see(v) = s = bitor(s, 2^v); while (seen(unseen), unseen++); while (seen(unseen odd), unseen odd += 2) other(x) = { if (x % 2==0, forstep (v = unseen odd, oo, 2, if (!seen(v) && gcd(v, x)==1, return (v); ); ), for (v = unseen, oo, if (!seen(v) && gcd(v, x)==1, return (v); ); ); ); } { for (n = 1, #a = vector(2^13), if (n==1, a[n] = 1, n%2, a[n] = other(a[n-1] * a[n+1]); ); if (n%2, see(a[n]); m = 2*n; while (m <= #a, a[m] = a[n]; m *= 2; ); ); print (n " " a[n]); ); } quit