1
$\begingroup$

How can we remove some arbitrary continuous pairs (n) in a list containing many pairs. For example:

list=RandomInteger[{1, 3}, {20, 2}];
(our random) list= (**{{1, 3}, {1, 1}, {3, 2}, {2, 3}, {1, 1}, {3, 3},
  {2,  1}, {2, 3}, {2, 2}, {3, 3}, {1, 2}, {3, 1}, {2, 1}, {2, 1}, 
 {1, 1}, {3, 1}, {2, 2}, {1, 1}, {1, 3}, {2, 3}}**)

We wish to have :

for n=3 {{1, 3}, {1, 1}, {2, 2}, {2, 1}, {2, 2}};
for n=4 {{1, 3}, {3, 3}, {1, 2}, {3, 1}};
$\endgroup$
  • 1
    $\begingroup$ Do you mean list[[1 ;; ;; 4]] and list[[1 ;; ;; 5]]? But the second expected result is different. I am wondering how you obtained n=4 $\endgroup$ – vapor May 27 '17 at 15:00
  • $\begingroup$ Yes I corrected that. Thank you. $\endgroup$ – Unbelievable May 27 '17 at 15:11
  • 1
    $\begingroup$ Related: Selecting every n-th element from a list. $\endgroup$ – Shadowray May 27 '17 at 15:13

Browse other questions tagged or ask your own question.