1
$\begingroup$

Is there some general formula for this? For some prime $p$, and some relatively prime $a$, I found that the number of elements in the set described seems to be $$\frac{p-1}{2^k}$$ where $k$ is maximal so that this value is an integer.

However, I found this by manually searching for the pattern in some code output, and some of my examples don't work. For example, for $p=97$, I found that $\{a^{-1}\mod p,a^{-2}\mod p,a^{-3}\mod p\dots\}$ contains $6$ elements. For $p=43$, I found that the set contains $7$ elements.

Also, I used $a=256$ in these cases.

What's amiss here?

  • 0
    What is your sequence of powers? Are they powers of $2$ or all integers? In other words, are you looking at $\{a^{-1},a^{-2},a^{-3},\cdots\}$ or $\{a^{-1},a^{-2},a^{-4},\cdots\}$?2017-02-21
  • 0
    Not sure this is clear. Why use $a^{-1}$ instead of $a$? If you are looking at all the powers, then just take $a$ to be a primitive root and you';ll get $p-1$. But maybe you mean something else.2017-02-21
  • 0
    You should get $p-1$. Perhaps you could share some code. For example, if you let $p=5$ and $a=3$, then $a^{-1}=2$, $a^{-2}=4$, $a^{-3}=3$, and $a^{-4}=1$.2017-02-21
  • 0
    For $p=43$ you can start with $a=3$ and you'll get $42$ elements. That's because $3$ is a primitive root mod $43$, every prime has primitive roots. For $p=97$, $a=5$ is a primitive root.2017-02-21
  • 0
    Oh, okay. It must have to do with my choice of $a=256$. If you're curious, the code is here: http://pastebin.com/PUDfSrFx2017-02-21

1 Answers 1

3

First, since $a$ is relatively prime to $p$, $a^{-1}$ is another element (called $b$), so we can replace all the negative powers of $a$ with positive powers of $b$. I'll just replace $a^{-1}$ by $a$ throughout.

Whenever $p$ is prime, there exists an element $a$, relatively prime to $p$ such that every number $x$ relatively prime to $p$ is equivalent to $a^k$ for some $k$. Therefore, the largest that your set can be is $p-1$ (and it occurs).

If you use a fixed $a$, then from group theory, we know that the multiplicative group is isomorphic to $\mathbb{Z}/(p-1)$ (the generator here is a primitive root). In this case, if $g$ is a primitive root, then $g=p^k$ for some $k$. The number of powers that you can get is the order of $k$ in $\mathbb{Z}/(p-1)$.