a = vector(10 000) os = Set([]) s = Set([]) nb = 0 try(x) = if (nb < #a, if (!set search(s, x) && !set search(os, x), s = set union(s, Set([x])); if (#s > 1000, os = set union(os, s); s = Set([])); nb++; a[nb] = x)) explore(x) = try(x+1); try(x*(1+I)) try(0) for (i=1, #a, x = a[i]; print (i " " imag(x)); if (nb < #a, explore(x))) quit