What conditions must be met to make f(x) = a^x mod N periodic but not constant?

61 Views Asked by At

The renowned quantum algorithm Shor's Algorithm relies on the periodicity of the function $f(x)=a^x mod N$. The a, x, and N are all positive integers.

By observation, we know the function is constant for some a and N. For example, $6^x mod 15 = 6$ for all positive x. In other words, $6^x mod 15$ is a constant function. So, which a and N can be used to guarantee the function is not constant. Any formulas or theorems?

By the way, could you please help prove or disprove $6^x mod 15$ is indeed 6 for all positive x?

I am just a programmer and not very good at number theory.

1

There are 1 best solutions below

2
On BEST ANSWER

$a^x\bmod N$ is constant if and only if $a^2\equiv a\bmod N$ which is to say if and only if $a^2-a$ is a multiple of $N$. In all other cases, the function is not constant.