Finding all factors of an integer

I’m not sure I understand your question correcty, but I think you’re looking for splatting:

Iterators.product(a...)

for example:

julia> a = [0:1, 0:2]
2-element Array{UnitRange{Int64},1}:
 0:1
 0:2

julia> collect(Iterators.product(a...))
2×3 Array{Tuple{Int64,Int64},2}:
 (0, 0)  (0, 1)  (0, 2)
 (1, 0)  (1, 1)  (1, 2)
5 Likes