# Questions tagged [sequence]

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

196 questions
Filter by
Sorted by
Tagged with
35 views

### How can this custom function generate the corresponding arithmetic sequence?

A function is to be constructed that, given an input of a positive integer value m, automatically enumerates all possible cases. Starting with an arithmetic sequence of length 4*m + 2, two terms are ...
• 4,523
112 views

### How to solve this problem combining sequences and reasoning using code?

QUESTION: Let $m$ be a positive integer, and let $a_1, a_2, ..., a_{4m+2}$ be an arithmetic sequence with non-zero common difference. If removing two terms $a_i$ and $a_j$ ($i < j$) leaves $4m$ ...
• 4,523
1 vote
129 views

### Convergence of $\left\{n!\sum_{k=1}^{n!}\frac{1}{k^{\frac{3}{2}}}\right\}$ as $n\to \infty$ using Mathematica or otherwise

Using Mathematica or otherwise, I need to find the convergence or divergence of$$\lim_{n\to\infty}\left\{n!\sum_{k=1}^{n!}\frac{1}{k^{\frac{3}{2}}}\right\}$$ where $\{x\}$ denotes the fractional part ...
• 155
91 views

### How to display the specific general term formula of Fibonacci sequence? [closed]

RSolve[{a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}, a[n], n] The general term formula obtained by the above code is: ...
• 4,523
297 views

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

Given the following list of rules (which might contain duplicate keys), I want to replace the string values with the first preceding numerical value. ...
• 81.4k
173 views

### Use sequence-functions to find certain sublists

I want to split a list of positive Integers into sublists whose ascending elements differ by 1. list = {1, 0, 1, 0, 1, 4, 5, 6, 5, 8, 1, 2}; This can be done ...
• 81.4k
103 views

### How to get the function-basis as they appear in the expression?

I have the following expression containing functions eg. Log, PolyLog etc, ...
• 1,897
115 views

### How can I find some first terms of a sequence?

I have a sequence knowing that $a_1=15$, $a_{n+1} = a_n + \sqrt{2a_{n+1}-a_n}$. I want to find some the first terms. I tried by my hand ...
• 1,131
101 views

### Why is there such a problem with finding a formula for the general term of a sequence?

FindSequenceFunction[{1, 2, 5, 14, 41}, n] 1/6 (3 + 3^n) You can directly calculate the general term formula above Why is it impossible to find the general term ...
• 4,523
93 views

### Generating sequence from a number with Precision

This question was from the End-Semester question paper of the previous year of my Course on Wolfram Mathematica - Apparently when I try to code it, something is going wrong with respect to Precision - ...
428 views

### Subdivide a sequence

Yesterday I couldn't solve a problem which seemed to be rather simple. I tried RepleaceRepeated, SequenceReplace and similar ...
• 81.4k
901 views

### Peaks, plateaus and ledges

I want to find the peaks, plateaus and ledges of an integer sequence, but all my attempts failed. 1. Example list ...
• 81.4k
187 views

### Joining constant arrays determined by a subsequence of contiguous block of ones

I have the following: data = {15, 25, 35, 45, 55, 65, 75, 85, 95, 105}; selector = {0, 1, 1, 0, 1, 1, 1, 0, 0, 0}; I want to create the following list from ...
1k views

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

I need a list of integers to check if a variable has one of the values of the list. If[ MemberQ[List,x], Green, Red] The list contains integers and is characterized ...
• 437
1 vote
67 views

### Why doesn't Sequence@@ work inside Manipulate[]?

I'm trying to use Manipulate[] and I need to have a non-fixed amount of sliders. I tried writing something like: ...
1 vote
42 views

### Sequence reconstruction from ordered subsamples

Given a sequence (we'll assume of integers) like seq = {1, 0, 0, 1, 2, 0, 1} I can take a random permutation ...
• 47k
340 views

### Split list into ascending sublists

I would like to split a list into non-overlapping, ascending (more precisely, non-descending with ≤) sublists. The function would be close to LongestOrderedSequence,...
• 2,240
242 views

### Find shortest subsequence

We will deal with arrays of chars, but not strings! Let we have the next three arrays: ...
• 1,849
45 views

### Derivative with respect to a sequence

I want D[Subscript[a, k],Subscript[a,j]] to return something like the Kronecker delta. Is this possible?
98 views

### Limit of Taylor coefficients

I want to calculate the following limit: b[n_] := (D[1/(1 - t), {t, n}] /. {t -> 0})/Factorial[n] Limit[b[n], n -> ∞] (* Indeterminate *) where ...
• 33
91 views

### When running code to compute a sequence, loop variable gets set to a constant

I would like to write Mathematica code to read in a list of sequences, and print the sequence definition ($a_n$), along with the sequence evaluated at a few values of $n$. ...
• 2,166
64 views

### How to use Shortest[___] with Sequence pattern matching?

Shortest[] doesn't appear to work with Sequence s. Is this a bug or a feature? What can I do to force the following ...
22 views

### Confusing result when pattern matching a BlankSequence (__) to a list, then calling unary function on the list [duplicate]

The following makes sense to me: In[1] = f[a, b] /. f[x__] -> x Out[1] = Sequence[a, b] In[2] = f[a, b] /. f[x__] -> {x} Out[2] = {a, b} However, the ...
• 191
675 views

### Select data from a structured list

Let's suppose we have the following structure of data ...
• 8,790
1 vote
101 views

### we want to get all possible values with $a_1$

I would appreciate it if somebody could help me with the following problem: Given a_{n+1}=\begin{cases} \dfrac{a_n}{2}& (a_n \: \text{even})\\ n{a_n}& (a_n \: \text{odd})\end{cases},\:a_8= ...
• 269
85 views

### Problem with For Loop when evaluating a recursive function at multiple points

I am running into problems with my For loop when trying to evaluate my expression. Fix some parameter values : ...
152 views

### Rewrite the list without certain elements in the sequence

I have a list1: ...
• 1,883
215 views

### One-to-multiple values relation from two excel columns

I have excel file with two columns: After data import I have the following list: ...
• 3,491
306 views

### Subsequences with distinct values

(this question was modified after initial answers) For a sequence x = {6,4,2,4,2,4,6} y = Subsequences[x] gives the list of ...
• 515
164 views

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

Is there a simple way to determine the run length of elements in a list that satisfy a pattern? For example, consider the following list: ...
• 377
192 views

### How to insert a list in the second argument of Table?

I wrote the following table: k = 4; T = Table[{a[n], 0, 1}, {n, 1, k}] Which generates: ...
• 5,411
87 views

### Isolating sequences from a list based on a formula

SeedRandom[4]; alist = RandomInteger[{-4, 4}, 100] From this list, I can isolate similar neighbors of length two: ...
• 56k
249 views

### Selective deletions from a list

i have two lists of strings with unequal numbers of subelements in each. i would like to remove from lis2 all instances where a pattern in lis1 appears in lis2: ...
• 4,873
199 views

### Trouble understanding function composition?

I made the following code: Cs = {{0, 1}}; f[x_] := (Clear[s]; s = (x[[2]] - x[[1]])/3; Splice[{{x[[1]], x[[1]] + s}, {x[[1]] + 2 s, x[[2]]}}]) Observe that we can ...
• 5,411
48 views

### How to find the sequence function $f(n,x)$ of the three given functions?

I have the three functions $f(2,x)$, $f(3,x)$ and $f(4,x)$ where $x>0$ ...
• 749
328 views

### While loop not working problem [closed]

I am new to Mathematica ,and I am trying to implement this while loop which adds all odd Fibonacci numbers less than or equal to 2 million but it keeps outputting 0 for sum. Any solutions for that? ...
• 31
46 views

### Problem with FindGeneratingFunction

I have a lengthy function of a real parameter $n$ that generates values $val$ for each $n$ {$n$, $val$}: ...
• 987
215 views

### Longest common subset sequence with gaps

I would like to find the longest common subset (including a gap of x) within two lists. Example: A = AAABBBBCCCCC B = CCCBBBAAABABA We can use ...
• 1,004
1 vote
126 views

### RSolve unable to solve the equation

I gave the following code as input: RSolve[x[n + 1] == 1/2 x[n] + 2 Log[x[n]], x[n], n] Mathematica gave the same output: ...
62 views

### Is there a concise way to generate a continuous less-than relationship?

Actually, I have a ton of variables, Let me simplify it to 4 in this post. vars = {a, b, c, d}; 0 < Less @@ vars < 10 0 < (a < b < c < d) < ...
• 26.9k
86 views

### How to solve this RecurrenceTable in Mathematica

I would appreciate if somebody could help me with the following problem: Q: How to define this in Mathematica. ...
• 269
254 views

### Variable dimension tables with variable ranges

I need to construct a table that has variable dimension and variable ranges (see for tables with variable dimensions and constant ranges, e.g., this question). Suppose there is a list ...
• 359
91 views

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

There are other similar questions on this site about using the Infix operator for more than two arguments, which I have read. But there is one thing that I wasn't able to understand and couldn't ...
• 952
77 views

### FindSequenceFunction with very small numbers

I need some help with FindSequenceFunction because at the moment it seems like a black box to me. For example, it deals with ...
• 1,195
102 views

### Patterns are not Sequences are not Lists, or: Global Function Argument Reversal

H[z_] := z /. {F[p__] -> F[Reverse[p]]} F[{x, y}] + F[{x, z}] + F[{}] // H Almost. It gives an annoying "Nonatomic Reverse" error message at the ...
• 1,143
80 views

### Defining function with arguments in a specific pattern similar to Graphics[]

I'm trying to define a function that is of this form: ...
• 117
113 views

### Finding recurrence relation from an inexact numerical sequence

Consider the recurrence relationship d[0] = 0; d[i_] := (1 + Sqrt[1 + 4 d[i - 1]^2])/2 /; i >= 1 which generates the following sequence (generated by using <...
• 489
1 vote
38 views

### What subsequences does SequenceReplace consider

Consider SequenceReplace[{a, b, x, x, a, c}, {a, e_} :> e]. What subsequences does SequenceReplace consider? The ...
• 829