title: Prolog: Generating Every Possibility of a List Given a Pattern
body: <p>Let's say you have a list in Prolog such as: [3,4,2,2,1,4]. How would one go about generating a list of lists of all possible patterns that start at the first element of the list, then either go to the i + 2th element, or the i + 3rd element, and so on from there. </p>
  
  <p>Example:
  Say I have [3,4,2,2,1,4,8].
  I want to be able to generate a list of lists such as:
  [[3,2,1,8], [3,2,4], [3,2,8]]</p>
  
  <p>I.e. all possibilities of either every other element or every i+3 element, or any other combination, such as i+2,i+3,i+2,i+2, etc. </p>
  
  <p>I've implemented my own version of a powerset, but I can't seem to figure out where to start. </p>