I found this question but it didn’t quite answer mine.
I want to list all the factors of a number, n. I found Primes.factor(n) which returns all the primes with their powers. And I found Iterators.product which could, in principle, give all the factors.
In Python, there’s an * operator that breaks out a list into separate inputs.
I created an array like this:
a = []
for p in Primes.factor(n)
append!(a,[0:p[2])
end
Then I wanted to iterate over all combinations of these powers:
for x in Iterators.product(*a)
#Do stuff with x being an array or tuple or list or whatever of powers
end
But I guess * is a python thing! Anyway, general hints, tips, and good ideas for how to do this in Julia?