Here's what I'm trying to do. First a simple example:
list[a_, b_, c_] := Module[{d},
d = Union[
Range[a, Prime[b], Prime[c]],
Range[a + 2, Prime[b], Prime[c]]]]
list[1, 8, 2]
{1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19}
Then I'd like to do
list2=Union[Table[list[Table[a,{a,0,c}],8,c,]],{c,3,5}]]
But I want the results to be as follows:
Union[list[0,8,3],list[0,8,4],list[0,8,5]],
Union[list[0,8,3],list[0,8,4],list[1,8,5]],
Union[list[0,8,3],list[0,8,4],list[2,8,5]],
Union[list[0,8,3],list[0,8,4],list[3,8,5]],
Union[list[0,8,3],list[0,8,4],list[4,8,5]],
Union[list[0,8,3],list[1,8,4],list[0,8,5]],
Union[list[0,8,3],list[1,8,4],list[1,8,5]],
...
Union[list[0,8,3],list[3,8,4],list[4,8,5]]
Union[list[1,8,3],list[0,8,4],list[0,8,5]]
...
Union[list[2,8,3],list[3,8,4],list[4,8,5]]
So, at present, my "list2" code isn't right, and I'm not sure what to do. After I get this fixed, then I'd like to create a list of primes:
plist=Table[Prime[p],{p,1,8}]
And do
Max[Max[Differences[Complement[plist,list2]]]]
so that 60 lists are created, each being the list of primes with a different line of list2, as outlined above, subtracted out. Then, each of those lists becomes a list of differences. Then the Max of those differences is found for each list. Then the max of all those max differences is found.
How can I get from where I am to where I want? Thanks
Outer[]
for this. $\endgroup$Outer[]
that you will be taking a generalized outer product of a list of lists. This last argument will tellOuter[]
to account for that. $\endgroup$