Guest User

Untitled

a guest
Jan 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. list1={1,2,3,4,5};
  2. list2={10,20,30,40,50};
  3.  
  4. list3={1+10,1+20,1+30,1+40,1+50,2+10,2+20,2+30,2+40,2+50,....,5+10,5+20,5+30,5+40,5+50}
  5.  
  6. Total[Tuples[{list1, list2}], {2}] (* or *)
  7. Join @@ Outer[Plus, list1, list2]
  8.  
  9. Tuples[Inactive[Plus][list1, list2]] (* or *)
  10. Join @@ Outer[Inactive[Plus], list1, list2]
  11.  
  12. Plus @@@ Tuples[{list1, list2}]
  13.  
  14. Flatten @ Outer[Plus, list1, list2]
  15.  
  16. Flatten[Table[
  17. ToString[list1[[i]]] <> "+" <> ToString[list2[[j]]], {i,
  18. Length[list1]}, {j, Length[list2]}]]
Add Comment
Please, Sign In to add comment