0

Given a finite integer field $\mathbb{Z}_p$ with $p>1$, I want to find the multiplicative inverse of an element $a\in\mathbb{Z}_p$ such that $a\cdot\hat{a}=1\colon\hat{a}\in\mathbb{Z}_p$.

First, assuming it exists, we can establish the following congruence:

$$a\cdot\hat{a}\equiv1\pmod{p}$$

Then, isolate the terms at one side to reach a congruence with 0:

$$a\cdot\hat{a}-1\equiv1-1\pmod{p}$$ $$a\cdot\hat{a}-1\equiv0\pmod{p}$$

By definition, we can deduce:

$$p\mid a\cdot\hat{a}-1-0\implies a\cdot\hat{a}-1=p\cdot q+0\enspace\colon q\in\mathbb{Z}$$ $$\hat{a}=\frac{p\cdot q+1}{a}$$

With this, it can be inferred that the quotient $q$ must cause $\frac{p\cdot q+1}{a}\in\mathbb{Z}_p$ to be met, so it is equivalent to express such condition as:

$$q = \min \{ q' \in \mathbb{N} / \frac{p \cdot q' + 1}{a} \in \mathbb{Z}_p \} \implies q = \min \{ q' \in \mathbb{N} : p \cdot q' + 1 \equiv 0 \pmod{a} \}$$

Now, if we define the sequence $s_{q,p,a} = \frac{p \cdot q + 1}{a}, \quad \{s_{q,p}\}_{q \in \mathbb{N}}$ and perform some evaluations starting at $q=0$:

$$s_{q,8,3}=\{1/3, 3, 17/3, 25/3, 11, 41/3, 49/3, 19, 65/3, 73/3, 27, 89/3, 97/3, \ 35, 113/3, 121/3\cdots\}$$ $$s_{q,11,4}=\{1/4, 3, 23/4, 17/2, 45/4, 14, 67/4, 39/2, 89/4, 25, 111/4, 61/2, \ 133/4, 36, 155/4, 83/2\cdots\}$$ $$s_{q,11,5}=\{1/5, 12/5, 23/5, 34/5, 9, 56/5, 67/5, 78/5, 89/5, 20, 111/5, 122/5, \ 133/5, 144/5, 31, 166/5\cdots\}$$ $$s_{q,14,5}=\{1/5, 3, 29/5, 43/5, 57/5, 71/5, 17, 99/5, 113/5, 127/5, 141/5, 31, \ 169/5, 183/5, 197/5, 211/5\cdots\}$$

It is seen that in some cases there holds $q=gcd(p,a)+a\cdot k\colon k\in\mathbb{Z}$, so at this point I have several questions:

  • What form must $p,a$ adhere to for $q=gcd(p,a)+a\cdot k\colon k\in\mathbb{Z}$ to hold?

In such cases, the following would be true:

$$\hat{a}=\frac{p\cdot (gcd(p,a)+a\cdot k)+1}{a}$$

So, by an equivalence of the $gcd()$ function:

$$\hat{a}=\frac{p\cdot \left(\frac{\displaystyle|p\cdot a|}{\displaystyle lcm(p,a)}+a\cdot k\right)+1}{a}$$

At this outcome, is there any way to formulate $lcm()$ as a closed form?

  • Finally, I would also like to know if a closed form exists that returns the value of $q$ from any $p,a$, and therefore the multiplicative inverse $\hat{a}$.
Bill Dubuque
  • 282,220
Cardstdani
  • 193
  • 13
  • 1
    For $\Bbb Z_p$ to be a field, $p$ must be a prime, so $p\ne8$ and $p\ne14$. – Anne Bauval Sep 18 '24 at 14:44
  • 1
    In your three examples, $\gcd(p,a)=1$, so your "It is seen that in some cases there holds $q=\gcd(p,a)+a\cdot k\colon k\in\mathbb{Z}$" seems rather arbitrary. – Anne Bauval Sep 18 '24 at 14:48
  • 4
    The multiplicative inverse of any non-zero $a$ is $a^{p-2}$ in $\mathbb{Z}/p\mathbb{Z}$ and this is the only "formula" i know of where we can explicitly write down the inverse. Another method is calculating the $\gcd(a,p)$ by the extended euclidean algorithm. – schiepy Sep 18 '24 at 15:07
  • @anne-bauval I have added a case where the distance from $q=0$ to the first integer in the sequence is the $gcd()$ shifted. – Cardstdani Sep 18 '24 at 15:09
  • 1
    See inverse reciprocity in the linked dupes. – Bill Dubuque Sep 18 '24 at 16:22
  • This additional case suffers from the same problem: $\gcd(p,a)=1$, so, based only on these examples, there is no reason to focus more on $q=\gcd(p,a)+ak$ than on $q=1+ak$. – Anne Bauval Sep 18 '24 at 18:15

0 Answers0