I started to learn discete logarithm the definition says that:suppose that "p" is a prime number , "r" is a primitive root (modulo p) and "a" is an integer between "1 and p-1" inclusive.If r^e (modp)=a and "e" is in [0,p-1] then the "e" is discrete logarithm of "a modulo p" to the base "r".
However, when I search in google, i encountered a discrete logarithm calculator.When i get the inputs into it, it gave unexpected results.For example, i wrote that 3^x(mod10)=7 and it results that x is 3.It was true but there was a contradiction with definition because 10 is not a prime number.The other exaple is that 3^x(mod11)=5, the contradictions with definition are that 3 is not primitive root(generator) of 11.However,the calculator answered it correctly such that x is 3.
My question is that is there any deficiency in my definition or is the calculator wrong ?Moreover, if my definition is correct , why did calculator answer the questions correctly? and can composite numbers have discrete log
The basic definition is that if $r^e \equiv a \mod n$, $e$ is a discrete logarithm of $a$ mod $n$ to base $r$. The theory is simpler if $n$ is a prime and $r$ is a primitive root mod $a$, but there is no reason not to consider the problem when $n$ is composite and $r$ is not a primitive root. Of course existence may not be guaranteed.