Questions tagged [sequence]

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

Filter by
Sorted by
Tagged with
33
votes
0answers
837 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 ...
19
votes
2answers
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 ...
11
votes
9answers
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: ...
17
votes
2answers
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 ...
14
votes
1answer
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 ...
4
votes
2answers
186 views

How can I use sequence in plotting domain?

I would like to plot a function but have a domain defined elsewhere as follows: xrange = Sequence[0, 2π]; Plot[Sin[x], {x, xrange}] However, this doesn't work ...
2
votes
1answer
531 views

how can I solve integrals including recursion of some sequences of functions

I would like to solve the equations as given below in mathematica. I have written some codes before but I have no idea when there is sub indexing to indicate the series of functions. I will be very ...
8
votes
5answers
461 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,...}, ...
6
votes
1answer
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 ...
10
votes
7answers
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 ...
10
votes
3answers
460 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 ...
5
votes
1answer
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 ...
3
votes
4answers
172 views

@ and Sequence ( and /@ ) [duplicate]

list = { {a,b}, {c,d}, {e,g} } How to efficiently get { f[a,b], f[c,d], f[e,g] } I tried various combinations using ...
2
votes
1answer
103 views

Sequence not working in Manipulate?

I have a function that I would like to construct the Manipulate parameter list with Sequence. This is a simpler example but it ...
14
votes
4answers
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. ...
7
votes
1answer
381 views

How to find a recurrence relation for a sequence?

I have a sequence given by an explicit formula for n-th term: ...
4
votes
4answers
1k views

Limit of sequence

I tried to calculate the following limit $$\lim_{n\to\infty}n\sin(2\pi en!)$$ Mathematica gets ...
4
votes
5answers
437 views

Sequence generation

If I wanted to generate a sequence that follows the pattern $$x_{n}=x_{n-1}+\dfrac{1}{2}\left(\sqrt{1-y_{n-1}\ ^{2}}-x_{n-1}\right)\\ y_{n}=y_{n-1}+\dfrac{1}{2}\left(\sqrt{1-x_{n}\ ^{2}}-y_{n-1}\...
4
votes
0answers
85 views

Pattern match Shortest BlankNullSequence in SequencePosition

Apologies if this has an answer somewhere but I can't find it. From the examples for SequencePosition we are shown that ...
3
votes
1answer
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: ...
2
votes
1answer
194 views

Generating a list of specific intermediate numbers associated with continued fractions

First of all, I don't know how ContinuedFraction[] or Convergents[] are implemeneted, and I think it is immaterial to my ...
2
votes
3answers
113 views

Using a piecewise defined sequence, find all $x_0$

Given $0\le x_0<1$, let $$x_n=\begin{cases} 2x_{n-1}, & \text{if $2x_{n-1}<1$}\\ 2x_{n-1}-1, & \text{if $2x_{n-1}\ge 1$} \end{cases}$$ for all integers $n>0$. For how many $x_0$ is ...
2
votes
2answers
355 views

Defining a sequence slot programmatically

This question is related to: Composition of functions using slots `Slot` (#) interfering with evaluation Consider a toy example: ...
1
vote
1answer
116 views

Finding general formula for this recursion function

I have a recursion relation defined as ...
1
vote
2answers
164 views

Plotting non-linear recursive sequence [closed]

I'm a total noob with Mathematica, and while trying to plot the following, I get several error messages. What am I doing wrong? ...
1
vote
2answers
114 views

How to define a recursive sequence

I would appreciate if somebody could help me with the following problem: Q: How to define this in Mathematica. $$a_{n+1}=\begin{cases} a_{n} & ,a_{n} \ge n\\ 2n-a_{n}& ,a_n<n \end{cases}...