Extracting every 3rd element from a list

Just Evan's icon

Hi, how can I extract every 3rd element of a list in order and vice versa, extract everything except every 3rd element, simply skipping it?

Example #1: from the list "A B C D E F G" I need to leave only "C F" (every 3rd element).

Example #2: from the list "A B C D E F G" I need to leave only "A B D E G" (everything except every 3rd element).

Just Evan's icon

My version:

I’ll just leave it here, maybe it will be useful to someone)

Max Patch
Copy patch and select New From Clipboard in Max.

sousastep's icon
Max Patch
Copy patch and select New From Clipboard in Max.

idk why the deferlow's needed but it is

Peter Ostry's icon

Other versions:

[regexp] should be able to do it in a single object, but I don't know how to write it.

Roman Thilenius's icon

your counter approach is good, but you do not even have to iter for that - you can use it with [zl nth].

another version would be iter - group 3 - zl slice - group

TFL's icon

Another iter/slice/groupe variation

Max Patch
Copy patch and select New From Clipboard in Max.