s = 0 unseen = 1 seen(v) = bit test(s, v) see(v) = s = bit or(s, 2^v); while (seen(unseen), unseen++) other(p) = { for (v=unseen, oo, if (!seen(v) && gcd(p, v)==1 && v!=p+1, return (v); ); ); } { a = vector(10 000); \\ A093715 u = 1; for (n=1, oo, see(v=if (n==1, unseen, other(v))); if (v<=#a, a[v] = n; while (a[u], print (u " " u-a[u]); if (u++>#a, break (2); ); ); ); ); } quit