What is the period of $f(X) = (A+K\cdot X) \mod N$

50 Views Asked by At

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?

1

There are 1 best solutions below

1
On

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}$$