siblings = vector(5 000, n, []) { for (n=2, #siblings, r = binomial(n); for (k=2, #r-1, c = r[k]; if (c > #siblings, break, siblings[c] = setunion(siblings[c], Set([r[k-1], r[k+1]])); ); ); apply (v -> print (m++ " " v), siblings[n]); ); } quit