1

I want to find the smallest $n \in \mathbb N$ such that $10^{n} \equiv 1 (\bmod 19)$. Using Fermat's Little Theorem,

$a^{p-1} \equiv 1 (\bmod p)$ if $p$ is prime and does not divide $a$,

I found that $n = 18$ is a solution to the congruency. It also happens to be the smallest natural number solution (the goal), but I don't know how to prove so.

(edit: without using guess-and-check)

Bill Dubuque
  • 272,048

3 Answers3

2

For any prime $p$ the multiplicative group of integers $(\mathbb Z/p\mathbb Z)^\times$ is a cyclic group of order $p - 1$. Indeed, this is a stronger restatement of Fermat's Little Theorem. Thus by Lagrange's Theorem, the order of its elements can only ever be the divisors of $p - 1$.

In your case, $p = 19$. So $10$ can only have order one of $1, 2, 3, 6, 9, 18$. You can test each to see that only $10^{18}$ gives $1$ modulo $19$.

balddraz
  • 7,558
  • Thanks for the succinct answer! But is there a way to do it without any guess-and-check? – Jesse Francis Jun 12 '23 at 05:22
  • 1
    @JesseFrancis This is known as the discrete logarithm problem and in its most general form, it is known to be hard. In the $(\mathbb Z/p \mathbb Z)^\times$ you can at least use Lagrange's Theorem as I did to narrow reduce the numbers we need to test. – balddraz Jun 12 '23 at 05:30
  • 3
    In general, any proper divisor of $n$ must divide $\tfrac{n}{p}$ for some prime $p$ dividing $n$. So it suffices to check $\tfrac{n}{p}$ for each prime factor $p$ of $n$. In this case $\tfrac{18}{2}=9$ and $\tfrac{18}{3}=6$. – Servaes Jun 12 '23 at 11:19
  • Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Jun 12 '23 at 13:15
1

We shall prove that there does not exist $n<18$ such that $10^n\equiv1 \pmod {19}$.

Suppose otherwise. Then $n<18$ and $$10^n\equiv10^{18}\equiv1\pmod {19}$$

Claim: $n\mid18$

Proof:

Suppose otherwise. Let $18=kn+r$ where $0<r<n$. Then, $$\begin{align*} 10^{18} &\equiv10^{kn+r}\\ &\equiv10^{kn}\cdot10^r\\ &\equiv(10^n)^k\cdot10^r\\ &\equiv10^r\\ &\equiv1 \pmod {19} \end{align*}$$

However, we defined $n$ to be the smallest positive integer such that $10^n\equiv1 \pmod {19}$, and here, we have $r<n$ and $10^r\equiv1 \pmod {19}$. Contradiction.

Hence, $n\mid18$. Now, it can be easily verified that $n=1, 2, 3, 6, 9$ do not satisfy the conditions. Contradiction again.

Therefore, there do not exist $n<18$ such that $10^n\equiv1 \pmod {19}$, so $n=18$ is the smallest value. Q.E.D.

There is still some checking involved, but it is greatly reduced from $17$ numbers to $5$ numbers.

Edit: As the comments have pointed out, we can further reduce this to $2$ numbers, by only checking $6$ and $9$. However, in this approach, you have to then prove beforehand that if $6$ do not satisfy then all the factors of $6$ do not satisfy either.

IraeVid
  • 3,216
  • 1
    Why not just show that $n|18$ directly? Seems like an unnecessary complication to subtract $n$. – Eric Jun 12 '23 at 05:19
  • Um I have already edited it before you commented. – IraeVid Jun 12 '23 at 05:20
  • Thanks for the solution! Greatly appreciate the number of numbers to check being reduced to 5, but is there a way to do it without any guess-and-check? – Jesse Francis Jun 12 '23 at 05:20
  • This is the simplest solution I know. Maybe others can provide a solution without guess-and-check! – IraeVid Jun 12 '23 at 05:21
  • 2
    You can just check 6 and 9. The others all are factors of those two, so if they’re not 1, then the others won’t be either. – Eric Jun 12 '23 at 05:33
  • 2
    In general, any proper divisor of $n$ must divide $\tfrac{n}{p}$ for some prime $p$ dividing $n$. So it suffices to check $\tfrac{n}{p}$ for each prime factor $p$ of $n$. In this case $\tfrac{18}{2}=9$ and $\tfrac{18}{3}=6$. – Servaes Jun 12 '23 at 11:18
  • Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Jun 12 '23 at 13:15
0

With such a small modulus, you can do it by inspection, using the following fact: if $\gcd(m,n) = 1$, then the order of $m$ mod $n$ — which is the power $x$ such that $m^x \equiv 1 \mod(n)$ — must divide $\phi(n)$. $\phi(n) = n-1$ for all prime $n$, so you just need to check the factors of $18$, which are $2, 3, 6$ and $9$ (there is no need to check $1$ and $18$, as we already know that $10^1$ is not congruent to $1$ mod $19$, while the opposite is true for $10^{18}$).

That's only $4$ possibilities to check, so let's begin. $10^2 = 100 \equiv 5 \mod(19)$, so that's out. $10^3 = 10\cdot10^2 = 10\cdot100 \equiv 10\cdot5 \equiv 50 \equiv 12 \mod(19)$, so that doesn't work either. $10^6 = (10^3)^2 \equiv 12^2 \equiv 144 \equiv 11 \mod(19)$, so again, no dice. Finally, $10^9 = 10^3\cdot10^6 \equiv 11\cdot12 \equiv 18 \equiv -1 \mod(19)$. Unfortunately, $1$ is not congruent to $-1$ mod$(19)$, thus proving that the least number $x$ such that $10^x \equiv 1 \mod(19)$ is indeed $18$.