I have a function $f$ mapping from integers to integers as follows:
$f(X) = (A+K \cdot X) \mod N$
Where $A,K,X,N$ are positive integers.
What is the period of the function?
I have a function $f$ mapping from integers to integers as follows:
$f(X) = (A+K \cdot X) \mod N$
Where $A,K,X,N$ are positive integers.
What is the period of the function?
Copyright © 2021 JogjaFile Inc.
We want $p$ minimal so that $f(x)=f(x+p)$. Hence $$a+kx\equiv a+k(x+p)\pmod{n}$$ We subtract $a$ from each side, then $kx$, to get $$0\equiv kp\pmod{n}$$