0

Is there a way to predict the same occurring numbers between two modulo sequence ?

Let me take an example Here are the first 21 numbers of the sequence A with modulo 7:

0   1   2   3   4   5   6
7   8   9   10  11  12  13
14  15  16  17  18  19  20

Here are the first 22 numbers of the sequence B with modulo 11:

0   1   2   3   4   5   6   7   8   9   10
11  12  13  14  15  16  17  18  19  20  21

If I decide to get the same occurring numbers in A, column 1 and B, column 4, I would see that 15 is occurring in both columns.

Is there a very efficient way/ generalization to gather the same number of differing modulo length, given a column to search per sequence ?

If the set is small, I know I could do a set intersection but I am after a generalized formula.

Thanks!

LeXav
  • 3
  • It's a bit unclear what you want. From the numbers we see that $$ 15 \equiv 1 \mod 7 $$ and $$ 15 \equiv 4 \mod 11 $$ Do I understand correctly that, what you're after, is a way to solve questions like: "What's a number that's $\equiv 1 \mod 7$ and also $\equiv 4 \mod 11$ ? " (and then you would be able to change the four numbers) – Matti P. Jan 29 '24 at 13:42
  • 2
    Maybe you need something like https://en.wikipedia.org/wiki/Chinese_remainder_theorem – Matti P. Jan 29 '24 at 13:44
  • @You are correct and thanks for the link I will dig into it – LeXav Jan 29 '24 at 14:01
  • Seconding that the Chinese Remainder Theorem should do the trick. – Michael Lugo Jan 29 '24 at 14:51
  • Apply CRT to solve $,x\equiv c_1\pmod{7},\ x\equiv c_2\pmod{11},,$ as in the linked dupe. – Bill Dubuque Jan 29 '24 at 15:33

1 Answers1

0

Your notation is slightly trippy. In essence, you really just wish to solve the equation $7x+c_1 = 11y+c_2$, where $c_1$ is the "column" from sequence A, and $c_2$ is the "column" from sequence B over $x,y \in \mathbb Z_{\geq 0}$.

In order to do that, first note that a necessary condition for this equation to hold on $x,y \in \mathbb{Z}$ is that $7 | 11y + c_2 - c_1$ as well as $11 | 7x + c_1 - c_2$. We can convert these two into congruences, and then solve.

In particular, this means $\bmod 11: 7x \equiv c_2 - c_1 \implies x \equiv 8(c_2 - c_1) \implies x = 11k_1 + 8(c_2 - c_1)$ with $k_1 \in \mathbb Z$. From the second condition $\bmod 7: 11y \equiv 4y \equiv c_1 - c_2 \implies y \equiv 5(c_1 - c_2) \implies y = 7k_2 + 5(c_1-c_2)$ with $k_2 \in \mathbb Z$. Now substitute $x$ and $y$ back into the equation, to get $7(k_2 -k_1) = 10(c_2-c_1)$ from which you substitute $k_2$ into the expression of $y$. Hence you get that $x = 11k + 8(c_2 - c_1)$, $y = 7k + 5(c_2 - c_1)$ with $k$ being written in place of $k_1$.

Then your desired numbers will be $\boxed{n = 77k + 56c_2 - 55c_1,\ k\in\mathbb Z}$, which is from substituting $x$ or $y$ into $7x+c_1$ or $11y+c_2$. Further, to calculate the row on which it lies in your first and second sequence, you'd need to find out $x$ and $y$ from this particular $k$. For your example setting $c_2 = 4$, $c_1$ gives us that $n = 77k + 169$ and here putting $k=-2$ gives us $n=15$. We can also figure out $x$ and $y$ given this $k$ to figure the rows in which $n$ lies in sequence A and sequence B respectively.

Sahaj
  • 2,516