[GAP Forum] Sublists of list

Siddiqua Mazhar (PGR) s.mazhar at newcastle.ac.uk
Thu Oct 2 15:13:27 BST 2014


Dear Sir/Madam,

My question is, if I have a list like

a:=[[1,2,4,6,11],[12,23,19,17,15]]

then how can I find the sublists of this list in GAP that are in the same order of the elements as it has been placed in the list. For instance I want to find the result in this form

result:= [1,2],[2,4],[4,6],[6,11],[11,1],[1,2,4],[2,4,6],[4,6,11],[6,11,1],[11,1,2],[1,2,4,6],[2,4,6,11],[12,23],[23,19],[19,17],[17,15],[15,12],[12,23,19],[23,19,17],[19,17,15],[17,15,12],[15,12,23][12,23,19,17],[23,19,17,15];


Kind regards
Siddiqua


More information about the Forum mailing list