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

learn more… | top users | synonyms

0
votes
0answers
39 views

Trying to understand Function with Sequence, Map and Block (FormCalc, FeynArts)

I am trying to understand some functions of FeynArts and FormCalc (http://www.feynarts.de/), but I don't have a clue what this function does (in Analytic.m): ...
7
votes
2answers
136 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$....
12
votes
2answers
236 views

Unexpected behavior of Sequence — using Sequence to delete parts of an expression

I thought that assigning Sequence[] to the part of an expression was an effective way to remove it. For example, the following code yields {2,3,4,5}: ...
2
votes
2answers
41 views

Find the Kimberling Sequence

How to find the Kimberling Sequence by using Mathematica? each row is obtained from the previous by boxing (and expelling) the main diagonal element, and then reading the first number after the ...
4
votes
0answers
37 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
2answers
80 views

Generating a sequence of lists [closed]

I have learnt how to generate a sequence of numbers, but now I come across a question whether it is possible to generate e sequence of lists. Say, I would like to generate {1},{1,2},{1,2,3},...,{1,2,3,...
0
votes
0answers
13 views

How to match sum of two or more objects? [duplicate]

I am trying to match expressions that are the sum of two or more objects with a specific head. However I can not get this work properly. For example ...
5
votes
1answer
84 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: ...
8
votes
9answers
366 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: ...
4
votes
3answers
225 views

Limit n->Infinity of recursive sequence

I have defined a recursive sequence a[0] := 1 a[n_] := Sqrt[3] + 1/2 a[n - 1] because I want to calculate the Limit for this ...
13
votes
4answers
901 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. ...
3
votes
3answers
118 views

How can I make custom accumulated sequences like the following?

First of all, I don't really know how to formulate the question, so if you understand my question and know a better way to phrase it, please revise. I have the following Matrixes: ...
2
votes
3answers
95 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 ...
6
votes
3answers
355 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 ...
1
vote
1answer
85 views

How to animate a graph generated by ListPlot command point by point?

I was wondering if it is possible to animate the following graph. The command used to generate the graph is the following: ...
1
vote
1answer
32 views

If the pattern changes in a nested List

I have a nested list in which part 2 of each sublist repeats itself a number of times before changing, i need an if condition for when part 2 of the next sublist changes from the prevous sublist. ex....
2
votes
2answers
548 views

Limit of sequence

I tried to calculate the following limit $$\lim_{n\to\infty}n\sin(2\pi en!)$$ Mathematica gets ...
7
votes
1answer
241 views
5
votes
0answers
57 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, ...
1
vote
4answers
337 views

Find a sequence given the sums of its terms

For a certain sequence of numbers, the sum of the first $n$ numbers in the sequence is given by $n^3+4n$ for all positive integers $n$. What is the fifteenth number in the sequence? How do you solve ...
6
votes
1answer
102 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 ...
3
votes
2answers
122 views

How to deduce the Ramanujan's summation of this series?

I have already asked a similar question about Ramanujan's summation in general but received no good answers. Now I am interested in this exact series: $$\sum _{n\ge1}^\Re (24 n + 12 n^2)$$
15
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 ...
11
votes
1answer
307 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 ...
4
votes
2answers
142 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 ...
0
votes
1answer
46 views

Compute an indefinite sequence of And

I would like to compute a condition of normalization over a set of vectors which has the form $$ (x_1.x_1 =1 ) \land ...\land (x_n.x_n=1) $$ Where the $x_i$ are vectors, and $n$ is a variable fixed at ...
1
vote
1answer
67 views

Change input parameter order in a function

I'm a beginner in Mathematica programming and I'm trying to understand how input parameters work in Mathematica's function. I encountered a problem with the sequence/order of the input parameters of ...
0
votes
1answer
62 views

Beginner: Iterative Sequence for Vector Function

I want to create an iterative sequence for two Vectorfunctions, where both are dependent on the same variables and i represents the vector. For simplicity let's ...
25
votes
0answers
573 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 ...
7
votes
5answers
327 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 ...
0
votes
1answer
66 views

Compute and Plot the element of a complex sequence

I'm new tho mathematica. I have a complex sequence ${z_n}$ with $z_0:=c$ $z_{n+1}=(z_n)^2+c$ for all $n\in N$ where c is some complex number, I need to plot the first 20 terms of this sequence ...
11
votes
2answers
294 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 ...
1
vote
2answers
74 views

Plotting non-linear recursive sequence

I'm a total noob with Mathematica, and while trying to plot the following, I get several error messages. What am I doing wrong? ...
8
votes
5answers
341 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,...}, ...
1
vote
1answer
48 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 ...
1
vote
0answers
103 views

Find algorithm or generator formula with automated procedure and pattern recognition

I am trying to find a generator formula for the discriminant of a polynomial and believe it would be an interesting problem for the Mathematica community to know how to automate evaluation of certain ...
1
vote
2answers
39 views

Imploying a sequence in a series

I would like to have the following sequence, $(a)_n$, in a series where $a_0 = 1$ and $a_n = a(a+1)\cdots (a+ n -1)$. The series I have is $$ 2\sum_{n=0}^{\infty}\frac{(1/2)_n}{n!(2n+1)^3} $$ I know ...
2
votes
0answers
58 views

pattern matching and applying a function, not working as expected [duplicate]

Consider the following code G[x, y] /. a_[b__] -> Total[a @@@ Permutations[List[b]]] I expect it to give G[x, y]+G[y,x] ...
2
votes
1answer
90 views

How to define the symbolic expression $V = \frac{1}{N} \sum_{i=1}^N ( y_i(g) - z_i)^2$ in Mathematica?

I want to define this expression symbolically: $V = \frac{1}{N} \sum_{i=1}^N ( y_i(g) - z_i)^2$ in which $\{y_i(g)\}_{i=1}^N$ is to be understood as a symbolic sequence that depends on a vector $g$. ...
1
vote
3answers
272 views

How to get mathematica to show limit of a recurrence sequence?

I want to find the limit of a such a sequence: $f(n+1)=\sqrt{2f(n)-1}, \, f(0)=a, a>1$ How does one do this? Is it possible to have it show the solution algebraically, like it does with ...
3
votes
3answers
164 views

Tangled up in sequences and recurrence relations

I took a trip through sequences and recurrence relations and I got tangled up since the documentation didn't help much. I'm sure you can. Given a sequence ...
1
vote
2answers
93 views

Number of sequences with a certain condition

Suppose I have the sequence {2, 4, 6, 8, 10, 12, 14, 16}. How could I calculate the number of tuples so that for every term save the first one, the difference from ...
2
votes
3answers
142 views

Can you compute more terms in this sequence?

I am trying to identify a sequence related to the von Mangoldt function matrix. Since I believe/conjecture that the columns in the matrix have period lengths as in this sequence b: ...
4
votes
5answers
370 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}\...
0
votes
1answer
70 views

Sequence not working as expected [duplicate]

From the help page: f[a, Sequence[b, c], d] No problem at all. ...
1
vote
1answer
105 views

sequence of matrix multiplications

My linear algebra book has questions that are are marked to use math software. There's probably some $50 guide on how to do everything but usually documentation has gotten me through. I've been kind ...
5
votes
2answers
1k 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 ...