2

I wanted to ask for a way to find primitve roots, because I didn't get it well. This is what I did:

For $n=338=2\cdot13^2$ we calculate $\varphi (\varphi(338))=\varphi(156)=\varphi(2^2\cdot3\cdot13)=48=3\cdot4^2$

$\Rightarrow$ there are $48$ possible primitive roots

For $1\le n \le156$ it is $\gcd(n,156)=1= \{1,5,7,8,9,10,11,14,...,155\}$

We know that the order is a divisor of $\varphi(338) \Rightarrow \operatorname{ord}\in \{1,2,3,4,6,13,156\}$

My question now is what exactly do I have to check ?

Something such that $x\equiv1\mod 338 $?

or anything else ?

Thanks in advance.

pinkpanther5
  • 945
  • 6
  • 16
  • See https://arxiv.org/pdf/0809.2139.pdf – lab bhattacharjee Jun 14 '17 at 12:53
  • 2
    We can prove if $g$ is a primitive root $\pmod p,$ either $h=g$ or $h=g+p$ will be primitive root $\pmod{p^2}$ https://math.stackexchange.com/questions/1832701/question-about-primitive-roots-of-p-and-p2?rq=1. Now if $h$ is odd, it will be primitive root of $$\pmod{2p^2}$$ else $$g+p^2$$ will be – lab bhattacharjee Jun 14 '17 at 12:56
  • Use the method from https://en.wikipedia.org/wiki/Primitive_root_modulo_n#Finding_primitive_roots – gammatester Jun 14 '17 at 14:06

1 Answers1

0

As I have already written in my comment, you can use the Wikipedia method (if you know the prime factorisation of $\varphi(n))$, which can be described as: For every non-square $g$ with $\gcd(g,n)=1$ check if all $g^{\varphi(n)/p_k} \not \equiv 1 \pmod n,$ where $p_k$ are the prime factors of $\varphi(n), $ in your case $2,3,13$. Here are the numbers

g=2: gcd(g,n)   = 2
g=3: 3^{156/2}  = 1 mod n
g=5: 5^{156/2}  = 337 mod n
g=5: 5^{156/3}  = 1 mod n
g=6: gcd(g,n)   = 2
g=7: 7^{156/2}  = 337 mod n
g=7: 7^{156/3}  = 191 mod n
g=7: 7^{156/3)} = 287 mod n

Therefore $7$ is the smallest primitive root $ \pmod {338}.$

A few notes: Exactly the numbers of the form $2,4, p^k, 2p^k$ with $p$ an odd prime have primitive roots. Square $g$ are obviously no primitive root, and since for general $n$ no simple general formula is known, you test $g=2,3,5,6,\dots$ and get as a bonus the smallest primitive root.

gammatester
  • 19,147