How to initialize this process to make it produce a sequence with specified period?

64 Views Asked by At

Let $S=(1,1,a)$. Then construct a new, infinite sequence $X$ using the following process:

  • First, $X_0=S_0=1$
  • Then add $S_0$ to each element of $S$, with letters being converted to their position in the alphabet and back after addition. The sequence $S$ is now $(2,2,b)$
  • Repeat with $S_1$. $X_1=S_1=2$.
  • Then add $2$ ($S_1$) to each element of $S$. $S$ is now $(4,4,d)$
  • Repeat. $X_2=S_2=d$, after addition, $S=(7,7,g)$
  • This time, $X_3=S_0=7$ and so on

All operations on numbers are modulo 10. All operations on letters are modulo 26 (e.g. $y+3=b$, $9+1=0$).

Is there a sequence which when this process is applied to, generates an $X$ which repeats itself? Until now, I've found $(1,1,a,s)$ which generates an $X$ of $(1,2,d,y,1,2,h,g,7,4,...)$

2

There are 2 best solutions below

3
On BEST ANSWER

Is there a sequence which when this process is applied to, generates an X which repeats itself?

$X$ is always eventually periodic

Any finite starting sequence $S$ will generate an $X$ that's eventually periodic.

Your $S=\tt 11a$ generates $X$ composed of the following period of length $117$ repeated infinitely: $\tt 12d74r50n36j12v50v12t36v36z74j74d12j36b36l36f74v98h36x50z50d36p74p36n50f50p50j98j50x36d50l12z98p12h12r12l50b12f98b74n$

Your $S=\tt 11as$ generates $X$ composed of the following period of length $96$ repeated infinitely: $\tt 12dy12hg74fc50ra74te12te74bu98ns74dy50jk98te98hg98lo12ns50xm50lo50pw74lo36te50vi98pw36jk12fc12pw$

Eventually periodic means that the periodic part may be preceded by finitely many elements. E.g., $S=\tt 11b$ produces $X=\tt \color{blue}{1}(2e86w48e00i86e62q00g62u48a62i24w00s86y6)^\infty$

Explanation

Your procedure can be seen as iterating the following rewrite rule, starting with $i=0$ and some initial tuple $S=(S_0,...,S_{l-1})$:

$$\left\langle i,(S_0,...,S_{l-1})\right\rangle\ \to \ \left\langle(i+1)\bmod l, ((S_0+S_i)\bmod b_0,...,(S_{l-1}+S_i)\bmod b_{l-1})\right\rangle $$ where $(b_0,...,b_{k-1})$ is a given tuple of bases specifying the base in which arithmetic is to be done in each position of the $S$ tuple, and $X_i=S_i$ in each iteration. Iterating this rule generates an infinite sequence of $\left\langle i,S\right\rangle$ values, $$\left\langle i^0,S^0\right\rangle \to \left\langle i^1,S^1\right\rangle \to\ldots\to\left\langle i^k,S^k\right\rangle\to\ldots,$$

in which $i$ takes values only in $\{0,...,l-1\}$, and the $j$th element of the $S$ tuple takes values only in $\{0,...,b_{j}-1 \}$; thus, there can be no more than $$l\times b_0\times\ldots\times b_{l-1} $$ distinct values of the pair $\left\langle i,S\right\rangle$. Consequently, some pairs must repeat in the infinite sequence; that is, there must exist $0\le j_1<j_2$ such that $$\left\langle i^{j_1},S^{j_1}\right\rangle\ =\ \left\langle i^{j_2},S^{j_2}\right\rangle, $$ which implies that the sequence of pairs (and hence the $X$ sequence) is eventually periodic.

Example

The following shows the initial $S=\tt 11b$ generating $X=\color{blue}{1}\tt (2e86w48e00i86e62q00g62u48a62i24w00s86y6)^\infty$:

   S = [1 , 1,  1]
base = [10, 10, 26]

count    i       S              X[count]
-----    --      ---------      --------
0        0       [1, 1, 1]      1

1        1       [2, 2, 2]      2
2        2       [4, 4, 4]      4
3        0       [8, 8, 8]      8
4        1       [6, 6, 16]     6
5        2       [2, 2, 22]     22
6        0       [4, 4, 18]     4
7        1       [8, 8, 22]     8
8        2       [6, 6, 4]      4
9        0       [0, 0, 8]      0
10       1       [0, 0, 8]      0
11       2       [0, 0, 8]      8
12       0       [8, 8, 16]     8
13       1       [6, 6, 24]     6
14       2       [2, 2, 4]      4
15       0       [6, 6, 8]      6
16       1       [2, 2, 14]     2
17       2       [4, 4, 16]     16
18       0       [0, 0, 6]      0
19       1       [0, 0, 6]      0
20       2       [0, 0, 6]      6
21       0       [6, 6, 12]     6
22       1       [2, 2, 18]     2
23       2       [4, 4, 20]     20
24       0       [4, 4, 14]     4
25       1       [8, 8, 18]     8
26       2       [6, 6, 0]      0
27       0       [6, 6, 0]      6
28       1       [2, 2, 6]      2
29       2       [4, 4, 8]      8
30       0       [2, 2, 16]     2
31       1       [4, 4, 18]     4
32       2       [8, 8, 22]     22
33       0       [0, 0, 18]     0
34       1       [0, 0, 18]     0
35       2       [0, 0, 18]     18
36       0       [8, 8, 10]     8
37       1       [6, 6, 18]     6
38       2       [2, 2, 24]     24
39       0       [6, 6, 22]     6

40       1       [2, 2, 2]      2
41       2       [4, 4, 4]      4
...

Finding an $S$ that generates a given $X$

Let $S=(S_0,S_1,\ldots,S_{l-1})^\infty$ (i.e. the infinite sequence obtained by repeating $(S_0,S_1,\ldots,S_{l-1})$), and let $b=(b_0,b_1,\ldots,b_{l-1})^\infty$ be the sequence of bases in which arithmetic is to be performed in the corresponding positions of $S$ and $X$. Now your procedure generating $X$ from a given $S$ can be conveniently written as follows: $$\begin{align}X_0&=S_0\quad\bmod b_0\\ X_1&=S_1+X_0\quad\bmod b_1\\ X_2&=S_2+X_1+X_0\quad\bmod b_2\\ X_3&=S_3+X_2+X_1+X_0\quad\bmod b_3\\ &\ldots\\ X_k&=S_k+X_{k-1}+X_{k-2}+\ldots+X_0\quad\bmod b_k\\ &\ldots\\ \end{align}$$ Inverting this we can produce an $S$ that will generate a given eventually periodic $X$, as follows: $$\begin{align}S_0&=X_0\quad\bmod b_0\\ S_1&=X_1-X_0\quad\bmod b_1\\ S_2&=X_2-X_1-X_0\quad\bmod b_2\\ S_3&=X_3-X_2-X_1-X_0\quad\bmod b_3\\ &\ldots\\ S_k&=X_k-X_{k-1}-X_{k-2}-\ldots-X_0\quad\bmod b_k\\ &\ldots\\ \end{align}$$

NB: The period of $S$ may be very much longer than the period of the $X$ that it generates. For example, $X=\tt (3d)^\infty$ is generated by $S$ with the following period: $\tt 3a7u1o5i9c3w7q1k5e9y3s7m1g5a9u3o7i1c5w9q3k7e1y5s9m3g7a1u5o9i3c7w1q5k9e3y7s1m5g9a3u7o1i5c9w3q7k1e5y9s3m7g1a5u9o3i7c1w5q9k3e7y1s5m9g$

0
On

After working on it for a bit (yes, this is what I do in my free time), I found that the starting sequence just needs to sum up to a multiple of both $10$ and $26$. So for example, a sequence consisting of $130$ nines would work and would generate $(9,8,6,2,4,8,6,2,4,...)$.

When only dealing with letters, you can have the sequence sum to a multiple of only $26$. So for example, the sequence $(s,m,u,i,y,d,f,f,u)$ produces $(s,e,q,u,e,n,c,e,x,s,e,q,u,e,n,c,e,x,...)$. Note the $x$, it's a padder to get the shift it back into position so that the next time the original sequence is restored.