Non-continuous subsequences: Difference between revisions
Content deleted Content added
Actually does the modification. |
|||
Line 1,689: | Line 1,689: | ||
</pre > |
</pre > |
||
=={{header|Mathematica}}== |
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
||
We make all the subsets then filter out the continuous ones: |
We make all the subsets then filter out the continuous ones: |
||
<lang Mathematica>GoodBad[i_List]:=Not[MatchQ[Differences[i],{1..}|{}]] |
<lang Mathematica>GoodBad[i_List]:=Not[MatchQ[Differences[i],{1..}|{}]] |
||
n=5 |
n=5 |
||
Select[Subsets[Range[n]],GoodBad]</lang> |
Select[Subsets[Range[n]],GoodBad]</lang> |
||
{{out}} |
|||
⚫ | |||
gives back: |
|||
⚫ | |||
=={{header|Nim}}== |
=={{header|Nim}}== |