gives the list of all possible subsequences of list.


gives all subsequences containing at most n elements.


gives all subsequences containing exactly n elements.


gives all subsequences containing between nmin and nmax elements.


limits the result to the first s subsequences.


gives if possible the s ^(th) subsequence.



open allclose all

Basic Examples  (2)

All possible subsequences:

All possible subsequences containing up to 2 elements:

Subsequences containing exactly 2 elements:

Scope  (6)

All subsequences of {a,b,c,d}:

The first 2 subsequences containing 3 elements:

All subsequences with even length:

The 181^(st) subsequence:

The odd-numbered subsequences of {a,b,c,d} in reverse order:

Use Subsequences with UpTo:

Generalizations & Extensions  (1)

Use any head:

Applications  (2)

Use Subsequences to obtain all subsequences common to two lists:

Or specify the length of the common subsequences to consider:

Compare to LongestCommonSubsequence:

Construct the boundary of a hexagon and color its sides randomly:

Properties & Relations  (5)

Subsequences is equivalent to a form of Partition:

Subsequences preserves the order of the input:

Different occurrences of the same element are treated as distinct:

SequenceCases can also find the subsequences of a list:

Construct a 3x3 Hilbert matrix:

Possible Issues  (2)

Subsequences[list,nspec,spec] only evaluates when all requested items are present:

Subsequences generates only one list of length 0:

This follows the behavior of Subsets:

Introduced in 2016