0

I am studying Linear Congruential Generators (LCG). In the proof of the main theorem of these generators:

Theorem: The sequence defined by $X_{n+1}=(aX_n+c) \;mod\;m$, has full period $m$, provided that:

$(i)$ $c$ is relatively prime to $m$

$(ii)$ $a\equiv 1 \pmod{p}$ if $p$ is a prime factor of $m$.

$(iii)$ $a\equiv 1 \pmod {4} $, if 4 is a factor of $m$

Thet sequence can be written as $$ \frac{(a^n-1)(x_0(a-1)+c)}{a-1}\equiv 0\pmod{m} $$ To reduce that expression to the following: $$ \frac{(a^n-1)}{a-1}\equiv 0\pmod{m} $$ The author says that that can be done because due to "the conditions of the theorem (I think $i$ and $ii$), $x_0(a-1)+c$ is relatively prime to $m$.

Why that's true? And why with that can the congruence be simplified?

Arturo Magidin
  • 398,050
  • 2
    Suppose otherwise. Let $p$ be a prime dividing both $m$ and $n=x_0(a-1)+c$. By $ii$ we have $a\equiv 1\pmod p$ so $n\equiv c\pmod p$. But $p$ can not divide $c$ (by $i$) so we have a contradiction. – lulu Nov 02 '20 at 12:51
  • I do not see what implies that $p$ divides $c$. Could you clarify that and post the comment as an answer to mark it as correct? – Antonio Gamiz Delgado Nov 02 '20 at 15:07
  • 1
    By assumption, $p$ divides both $m$ and $n$. Thus $n\equiv 0\pmod p$. But $n\equiv c\pmod p$ (by, simple, calculation) so we must have $c\equiv 0 \pmod p$, hence $p$ divides $c$. – lulu Nov 02 '20 at 15:36
  • 2
    If you like: you can post a solution yourself. That's a good way to make sure you are on top of the calculation. I'll gladly check your post once it is up. – lulu Nov 02 '20 at 15:38

2 Answers2

1

Suppose otherwise. Let $n=x_0(a-1)+c$ and $p$ prime such that $p|m$ y $p|n$. By $ii$, we have that $a\equiv 1\,(\,mod\,p)$, that is: $$ a = 1+kp, \;k\in\mathbb{N} \Rightarrow x_0(1+kp-1)+c\;(\;mod\;p) = c \Rightarrow n\equiv c\,(\,mod\,p) $$ But we have assumed that $p|n$, therefore $n\equiv 0\,(\,mod\,p)$, but $p\nmid c$ (by $i$), so we have a contradiction.

1

A $1$-line proof shows $\,b+c\,$ is coprime to $m$ if every prime factor $p$ of $m$ divides $b$ or $c$ but not both. OP is special case: all $\,p\mid b\! =\! x_0(a\!-\!1)\,$ by $\,p\mid a\!-\!1;\,$ no $\,p\mid c\,$ (else $\,p\mid c,m\,$ contra $c,m$ coprime).

Remark $ $ As explained in the linked post. this simple idea (going back to Stieltjes) allows us to generalize Euclid's proof of infinitely many primes to a proof of infinitely many $\rm\color{#c00}{co}primes$ in an arithmetic progression (a much simpler $\rm\color{#c00}{co}prime$ analog of Dirichlet's famous theorem). This very simple result is often overlooked — leading to more complex and less conceptual proofs.

Bill Dubuque
  • 272,048