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. For example,
FreeQ[mySeq, 1]
generates an error message.
So I wanted to test if…
I have a stream of data like this:
0001100111100000111111001110000001111111111000000111000111110000...
(I can represent them as a list, like in {0,0,0,1,1,...}, I guess that's easier to work with.)
Now I want to count how many sequences of two…
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 standard (non-recurrence) limits in WolframAlpha? (I wasn't…
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}\right)$$
rather than writing the whole thing out:
x0…
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
k := 15;
Solve[x == k + Sqrt[2 x - k], x]
{{x -> 20}}
k := 20;
Solve[x == k + Sqrt[2 x - k], x]
{{x ->…
Could you explain the details for the following code?
foo[x_, y_] := {a, If[x === y, b, Sequence @@ {}]}
foo[s, s]
foo[s, t]
Output:
{a,b}
{a}
Why isn't the output as follows?
{a,b}
{a,}
I wrote the following table:
k = 4;
T = Table[{a[n], 0, 1}, {n, 1, k}]
Which generates:
{{a[1], 0, 1}, {a[2], 0, 1}, {a[3], 0, 1}, {a[4], 0, 1}}
Now in the I want to use this in the next table:
Table[Table[a[n], {n, 1, 4}], x]
In a way that makes…
I am trying to determine that how my sequence(probe) "hits" against a long sequence(genome). The LongestCommonSubsequence in Mathematica gives the first longest common subsequence between two sequences.
Is there a good way to find the second…
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 formula below?
In[1]:= FindSequenceFunction[{2^1, 2^2, 2^5, 2^14, 2^41}, n]
Out[1]=…
First of all, I don't know how ContinuedFraction[] or Convergents[] are implemeneted, and I think it is immaterial to my question.
for some number $x$ there's an associated continued fraction representation $[a_1,...,a_i,...]$ (finite or not), and,…
I stumbled upon this code by Leonid Shifrin. He uses Sequence[] to create void or non-existent output. I was wondering whether this is really the best way to generate non-existent output in that way? What are alternatives? I was looking for a…
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 it true that $x_0=x_5$?
The answer is supposedly 31.
Does anyone…
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 this problem the most efficient way?
I'm a total noob with Mathematica, and while trying to plot the following, I get several error messages. What am I doing wrong?
O[n_] := O[n] = 0.7*O[n - 1] + 0.002*O[n - 1]*M[n - 1] ;
M[n_] := M[n] = 1.2*M[n - 1] - 0.001*O[n - 1]*M[n - 1] ;
O[0]…