Suppose I have multiple lists, the first one contains 2 elements, the next one 4 elements, the next one 8 elements, and so forth.
Let these elements be labeled as Gij where i refers to the list it comes from and j refers to the position it occupies in that list.
How would I go about generating the following recursive sequence.
{G11, G12, G11 + G21, G11 + G22, G12 + G23, G12 + G24, G11 + G21 + G31, G11 + G21 + G32, G11 + G22 + G33, G11 + G22 + G34, G12 + G23 + G35, G12 + G23 + G36, G12 + G24 + G37, G12 + G24 + G38, ...}
Flatten@FoldList[ Flatten@MapThread[ Outer[Plus, {#1}, #2] &, {#1, Partition[#2, 2]}] &, lists]wherelistsis the list of your lists... – ciao Jun 27 '15 at 23:08