How to compute $x_{2i}$ directly from $x_i$ in this $x^2 \mod N$ sequence?

36 Views Asked by At

$\DeclareMathOperator{\modulo}{mod}$ Let $x_0$ be an initial value less than $N$. Let $f(x_{i+1}) = x^2_i \modulo N$. Then \begin{align*} x_{2i} &= \overbrace{f(... (f(f}^{i\text{ times}}(x_i) \modulo N)) \modulo N ...) \modulo N \end{align*} Is there non recursive function $g$ such that $x_{2i} = g(x_i)$? What is this function? (I mean: what is its formula? Can you find it?) What if we ignore the modulus N? Could we find it then?

Example. Let $f(x_{i+1}) = x^2_i \modulo N = 589$ with $x_0 = 3$. Then $(x_n) = 3, 9, 81, 82, 245, 536, 453,$ ... Considering $x_6$ in terms of $x_3$ we find \begin{align*} x_6 &= 453\\ &= f (536)\\ &= f\left(f (245)\right)\\ &= f\left(f\left(f(82)\right)\right)\\ &= f\left(f\left(f(x_3)\right)\right)\\ &= f\left(f (x^2_3)\right) \\ &= f \left(x^2_3\right)^2\\ %% x^{2^2}_3 &= \left(\left(x^2_3\right)^2\right)^2. %% x^{2^{2^2}}_3 \end{align*}

Can we get $x_6$ directly from $x_3$ without iterating $f$ for $6/2 = 3$ times?

1

There are 1 best solutions below

2
On BEST ANSWER

Remainder class equivalence is a congruence with respect to multiplication, that is, $a \equiv b \bmod N$ and $c \equiv d \bmod N$ implies $ac \equiv bd \bmod N$. Now to be rigorous about why this is true we should be reasoning in terms of equivalence classes, but since you're taking the $\bmod$ operation as taking the remainder of the division, it should be enough for you to know that you can simply leave the remainder-taking at the end of any chain of summations and multiplications. So your succession is really: $$ x_i= x_0^{\overbrace{2\cdot2\cdot\dots\cdot2}^{i\text{ times}}} \bmod N = x_0^{2^i} \bmod N $$

Now, to answer your question, we can see that: $$ x_{2i} = x_0^{2^{2i}} \bmod N = x_0^{2^i\cdot2^i} \bmod N = (x_0^{2^i})^{2^i} \bmod N = x_i^{2^i} \bmod N $$ Notice that the last equivalence holds because $x_0^{2^i} \equiv x_i \mod N$.