Wolfram: Riffle (Add at Every Nth)
Riffle. (Intersperse. Add at Every Nth)
Riffle-
Riffle[ list, x ]Riffle[ list, x, n ]Riffle[ list, list2 ]
intersperse x into the list, at every nth (default 2). Or intersperse 2 lists list, list2 .
Riffle[ {1, 2, 3}, x ] (* {1, x, 2, x, 3} *) Riffle[ {1, 2, 3}, x, 2 ] (* {1, x, 2, x, 3} *) Riffle[ {1, 2, 3, 4, 5, 6}, x, 3 ] (* {1, 2, x, 3, 4, x, 5, 6} *)
Riffle[ {1, 2, 3}, {a, b, c} ] (* {1, a, 2, b, 3, c} *)
Wolfram. List Operations, and Loop, Iteration, Recursion
- Wolfram: List Operations
- Wolfram: List. Create (Table)
- Wolfram: Create Flat List (Range)
- Wolfram: List. Get Parts
- Wolfram: List. Add Element
- Wolfram: List. Delete Element
- Wolfram: List. Change Element
- Wolfram: List. Check Exist
- Wolfram: List. Filter
- Wolfram: List. Sort Reverse Ordering
- Wolfram: Flatten
- Wolfram: Riffle (Add at Every Nth)
- Wolfram: RotateLeft
- Wolfram: Padding
- Wolfram: List. Partition, Reshape, Split, Gather
- Wolfram: Transpose
- Wolfram: List. Same Items Counts, Tally, Group
- Wolfram: List. Combinatorics
- Wolfram: List. Join, Union, Intersection, Difference
- Wolfram: Iteration
- Wolfram: Map Function to List
- Wolfram: Scan (foreach)
- Wolfram: Recursion
- Wolfram: Fold (reduce)
- Wolfram: Loop