# Tag Info

Accepted

### Using Sequence to delete a part of an expression

What happens to the list after we assign an element to Sequence[] The answers given so far already contain most of the pieces needed to explain this behavior, but I ...
• 115k
Accepted

### Select data from a structured list

Maybe there is something more elegant, but there you go: Cases[data, {n_Integer} | {_?(LessThan[2]), b__} :> {n, b}]

### Select data from a structured list

SequenceReplace[{ a : {_, _, _, _} ...} :> Sequence @@ (Rest /@ Select[First@# <= 2 &]@{a})] @ data {{1}, {-12.7758, -0.00980164, 0.00032368}, {-12....
• 398k
Accepted

### How do I test if a variable represents a sequence?

You may make a helper function with attribute SequenceHold. ...
• 42.4k
Accepted

...
• 48.3k
Accepted

### Split list into ascending sublists

I think this must be a duplicate, but as the answer below is (almost) identical to an example in Split, I have tagged it ...
Accepted

### Peaks, plateaus and ledges

list = {0, 0, 1, 2, 2, 3, 4, 4, 5, 5, 5, 4, 3, 3, 2, 2, 3, 2, 1, 1, 2, 2, 1}; Using SequencePosition with patterns that ...
• 398k

### Split list into ascending sublists

Using SequenceSplit: SequenceSplit[ls, {x_, y___}?OrderedQ :> {x, y}] (*{{2, 3}, {1, 2, 3, 3}, {2}, {1}}*)
• 25.7k

### How can I define a sequence of Integers which only contains the first k integers, then doesnt contain the next j integers, and so on

Flatten@Partition[Range[listmax], k + j][[All, ;; k]] Edit: Or, using the 3rd argument to Partition, ...
• 13.8k
Accepted

### How can I define a sequence of Integers which only contains the first k integers, then doesnt contain the next j integers, and so on

BlockMap[Splice, Range@listmax, k, k + j] Since you haven't defined the edge case behavior, this might not actually give you what you want. For example: ...
• 30.2k

...
• 398k
Accepted

### Find Sequence Function Error?

If you examine the documentation page of FindSequenceFunction you'll see it has an option called FunctionSpace. Its doc page ...
• 65.9k

### Locate Start and End Positions of Repeated Sequences in a list

In versions 10 and later, you can get the result using a single function SequencePosition: ...
• 398k
Accepted

### The use of SlotSequence in If[#1 > #2, ##] &

The answer is simple: First, you really need to look up the documentation of ##. It means "take all arguments". But more importantly, you can use the property that <...
• 113k

### Computing limit of $\frac{1}{n \sin \left(\pi ^6 n\right)}$ over integers

An appropriate tool for calculating limits of sequences over integers is DiscreteLimit. However ...
• 57.5k
Accepted

### A possible issue in combination of the Infix operator ~ with Sequence

Look at: Attributes[If] (* {HoldRest, Protected} *) Now consider: If[#1, Sequence @@ {2, 3}] & Because of the "...
• 53k
Accepted

### Replacing string values with one of the sequence-functions

sr = SequenceReplace[{a : (_ -> n_?NumberQ), b : (_ -> _String) ..} :> Sequence[a, Splice[# -> n & @@@ {b}]]] sr @ list ...
• 398k
Accepted

### Summing factors of binomial coefficients - get general formula?

By inspection of the first few terms we can infer that the correct generalization should be: fun[m_, n_] := Sum[(-1)^(q + m) Binomial[m - 1, q - 1] q^n, {q, 1, m}] ...
• 12k
Accepted

### Turning arguments into exponents

Here's an explanation of why you get {4}. As mentioned above, your problem is the use of Rule instead of ...
• 131k
Accepted

### Splice matching function arguments

The docs say that Splice[{e1,e2,…}] is equivalent to Sequence[e1,e2,…] when the outer wrapping head is ...
• 6,151
Accepted

### What does Sequence[2,4]^2 mean?

Switching away from infix notation might make things more clear: Sequence[2, 4]^2 === Power[Sequence[2, 4], 2] === Power[2, 4, 2] According to the documentation ...
• 36.3k
Accepted

### Find the longest sequence of "1" in a SubList

It's because of the canonical order of expressions. Even though -∞ < 4 is true, Order[-∞, 4] is ...
• 20.3k
Accepted

### Determining the run length of elements in a list that satisfy a pattern

digit = {0.2, 0.9, 0.6, 0.6, 0.7, 0.4, 0.3, 0.2}; SequenceSplit[digit, {_?(# <= 0.5 &)}] {{0.9, 0.6, 0.6, 0.7}} This ...
• 55.6k

### Select data from a structured list

A trivial way: select those data for which the first number of the four is less than 2 keep the counting lone integers keep only the last three columns of the sets. translate: ...
• 9,978

### Select data from a structured list

res1 = data /. {{a_, b_, c_, d_} :> {b, c, d} /; a < 2 , {a_, b_, c_, d_} :> Nothing} Or phrased the other way round: ...
• 55.6k

### Split list into ascending sublists

Found a solution by myself: SequenceCases[ls, {__}?OrderedQ] Wonder if there's a neater one :)
• 2,240

### Positions of elements in the initial flattened list in a split list

InternalCopyListStructure is quite fast: InternalCopyListStructure[Split @ #, Range @ Length @ #] & @ m1 ...
• 398k

### How do I test if a variable represents a sequence?

Internal`InheritedBlock[{FreeQ}, SetAttributes[FreeQ, SequenceHold]; FreeQ[mySeq, 1] ] False
• 137k

### How do I test if a variable represents a sequence?

This tests if a symbol represents a Sequence: With[{a = mySeq}, HoldComplete[a][[1, 0]]] === Sequence or: ...
• 20.3k