Questions tagged [sequence]

Questions on specifying order in and splicing of lists, including use of Mathematica Sequence objects.

119 questions
Filter by
Sorted by
Tagged with
836 views

Performance problems in new Sequence functions

The new-in-10.1 Sequence* family of functions should provide newly optimized methods for handling sequence problems. Happily in some cases they do! For example ...
437 views

Using Sequence to delete a part of an expression

I thought that assigning Sequence[] to a part of an expression is an effective way to remove it. For example, the following code yields ...
1k views

What happens when you divide by ##?

I've been playing around with sequences a bit. In particular with using ## with unary and binary operators. Let's start simple, the following all make some kind of ...
623 views

How do I test if a variable represents a sequence?

I created a variable that represents a sequence: mySeq = Sequence[1, 2, 3]; I wanted to use that variable as an argument for some functions. But I got in trouble....
1k views

How can I return a Sequence?

Recently I had the need to redefine a certain symbol in my init.m so it would be automatically omitted from any lists it appears in. I decided to redefine it to an empty sequence, e.g. ...
211 views

Pattern matching with List and Optional

Bug introduced in 8.0.4 or earlier and persists through 11.1.1 Thank you for bringing this to our attention. I have filed a report with our developers. Why does this ...
459 views

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

Say, we have a list: m1 = {2, 2, 7, 0, 7, 7, 2, 2, 2} It can be split easily: ...
178 views

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

The below function when applied to a list of two elements, will output the maximum between the two: If[#1 > #2, ##] & For example: ...
321 views

Empty Blank regression in v10.1

Bug introduced in 10.1 and fixed in 10.2.0 In v10.1.0.0 on Linux, when Blank[] is used in Alternatives with pattern that can ...
687 views

Counting subsequences (i.e., patterns) within a list?

I would like to count the number of subsequences in list. Say I have data given by: data = {1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1}; I would like to count the number ...
512 views

Repeating Digits

I have written ...
459 views

How to implement symbolic Ramanujan's summation in Mathematica?

How to implement Ramanujan's summation in symbolic form in Mathematica? For instance, I want as input the function $f(x)=x$, as output $-1/12$, as input $f(x)=1/x$, as output $\gamma$ (Euler's ...
694 views

Is it possible to find a limit of a sequence given by its recurrence relation?

I need to calculate a limit of a sequence given by its recurrence relation. I tried the following: ...
502 views

...
460 views

How can I tally continuous sequences in a list?

I have a stream of data like this: 0001100111100000111111001110000001111111111000000111000111110000... (I can represent them as a list, like in {0,0,0,1,1,...}, ...
381 views

How to find a recurrence relation for a sequence?

I have a sequence given by an explicit formula for n-th term: ...
300 views

FindSequenceFunction for sum of hypergeometric terms?

The built-in function FindSequenceFunction is quite good at recognizing hypergeometric terms, i.e. terms $c_k$ for which $c_{k+1}/c_k$ is a rational function of $k$....
444 views

Match a sequence of integers

I would to match a pattern p1 = 0,0,1,0,0 to the elements in listA. The elements are a boolean sequence that may look like this ...
110 views

Are there different Method options that can be used with FindSequenceFunction?

The help page states that Method is an option to use with FindSequenceFunction, but I don't find any further information. (There ...
152 views

Find subsequence A in sequence B A007908 - OEIS

I have sequence A as A007908 - OEIS and pattern B which is a sub-sequence of that sequence A. I need to find index of first occurrence of the given pattern. For example pattern ..1010... I've looked ...
373 views

Turning arguments into exponents

I'd like to replace every instance of L[stuff], e.g., L[-1,-2,-2] in an expression with ...
102 views

An unexpected match when using Condition, Optional and passing a Sequence

Mathematica is behaving in an expected way when passing a parameter with an Optional and a Sequence. Here is an example: ...
2k views

How to find a recurrence relation for a numerical sequence?

This question was inspired by Vladimir Reshetnikov's question (How to find a recurrence relation for a sequence?): Given a finite sequence of numbers, how can we find in MMA a recurrence relation ...
61 views

How to set up patterns when using SequenceSplit

Given a list lst={0,0,0,0,0,"A1",0,0,0,"B2",0,0,"C3","D4","E5",0,0,0,"F6"} How to split it as ...
136 views

How to find the length of an indefinitely repeated sequence in a list

Here, I am not looking for simply a repeated element, but an indefinitely repeated sequence. For example, if I have the list ...
235 views

Find the domain in which a sequence converges

I seem to have a lot of problems in the format of: Given the sequence $a_n=\frac{n^\alpha+1}{2n^8+5}$, for $\alpha > 0$, find the values of $\alpha$ such that the sequence converges. However, I ...
81 views

SimilarityRules for SequenceAlignment of two lists

I am trying to use the SimilarityRules option of SequenceAlignment to customize its output. This works perfectly for strings, ...
437 views

137 views

Taking a long time to produce output

In the following, I want to know b, but it is taking a very long time even for b. Please help ...
62 views

FindGeneratingFunction gives up too easily [closed]

I am trying to automatically find a generating function from the coefficients of a simple rational function using Mathematica's FindGeneratingFunction: ...
86 views

When does Slot evaluate?

I looked up the related answers, it must have to do with the scope. Toy example similar to mine in structure: ...