# A variant on Wieferich primes

Recall that a Wieferich prime is a prime number $$p$$ such that $$2^{p-1} \equiv 1 \bmod p^2.$$ It is not known whether there are infinitely many Wieferich primes, nor whether there are infinitely many non-Wieferich primes. In fact there are only $$2$$ known Wieferich primes.

I'm interested in a slightly different condition which I'm hoping is easier to handle. Namely, I can replace the exponent $$p-1$$ by the order of $$2$$ in $$(\mathbb{Z}/p\mathbb{Z})^\times$$. Moreover, I just want this power to hit the identity with odd $$p$$-adic valuation. Specifically:

Are there infinitely many primes $$p$$ such that $$v_p(2^{\mathrm{ord}_p(2)}-1)$$ is odd?

Here $$\mathrm{ord}_p(n)$$ denotes the order of $$n$$ in $$(\mathbb{Z}/p\mathbb{Z})^\times$$ (which divides $$p-1$$ by FLT), and $$v_p$$ is the $$p$$-adic valuation.

Note that the existence of infinitely many non-Wieferich primes would provide a positive answer to my question (since here $$v_p(2^{p-1}-1) = 1$$).

Ideally I'd also like to know that there collection of such primes has positive density, rather than just being infinite.

• Do you possibly mean $v_p(2^{{\rm ord}_p(2)}-1)$ instead of $v_p(2^{{\rm ord}_p(2)})$? Jun 29, 2020 at 20:37
• Yes thanks, now fixed. Jun 29, 2020 at 20:44
• Since $v_p(2^{{\rm ord}_p(2)}-1)=v_p(2^{p-1}-1)$, you might as well keep the exponent simpler. Jun 29, 2020 at 21:59
• @Pace: Nice observation. How do you show this? Jun 30, 2020 at 10:32
• @DanielLoughran Let $x={\rm ord}_p(2)$. Write $2^x=1+ap^k$ where $gcd(p,a)=1$. Now, the order of $2$ modulo any larger power of $p$ must be a multiple of $x$, say $xy$. We compute that $2^{xy}=(1+ap^k)^y=1+yap^k+$terms divisible by $p^{k+1}$. We see that this is $1$ modulo $p^{k+1}$ if and only if $p|y$. Jun 30, 2020 at 16:24

Suppose the answer is no and that the finitely many exceptions are all at most $$B$$. Let $$\ell \equiv 1 \pmod{3}$$ be prime and consider $$n=2^{\ell} -1$$. If $$p>B$$ is a factor of $$n$$, then $$\ell$$ is the order of $$2$$ modulo $$p$$, so $$p$$ occurs in $$n$$ with an even exponent, so $$n = x^2c, c \le B!$$. Let $$y = 2^{(\ell - 1)/3}$$. Then $$n=2y^3 - 1$$ and finally $$2y^3 - 1 = cx^2$$, so $$(x,y)$$ is an integral point on one of a finite collection of elliptic curves and there can be only finitely many such. But there are infinitely choices for $$\ell$$, contradiction. (This is a variant of an old argument of Granville.)
• I think one can make the argument a bit simpler, keeping the same basic idea. Since $\ell$ is the order of $2$ mod $p$, we have $p > \ell$. Thus, as long as we choose $\ell > B$, we have $2^{\ell}-1$ coprime to $B!$. So $n$ is actually a square, which is absurd since $n\equiv 3\pmod{4}$. In this variant there's no need to restrict the primes $\ell$ to the progression $\ell\equiv 1\pmod{3}$, Jun 30, 2020 at 19:01
• I'm guessing the Granville paper in question is mathscinet.ams.org/mathscinet-getitem?mr=841645 . It seems that the state of the art only provides $\log X$ or so non-Weiferich primes up to $X$, even if one assumes the abc conjecture (see e.g. the recent paper mathscinet.ams.org/mathscinet-getitem?mr=3983273 ) so I doubt positive density is within reach of current methods. Jun 30, 2020 at 19:21
• ... though on the other hand, this argument does seem to imply that for every prime $\ell$, there is a prime $p$ with $ord_p(2)=\ell$ and $v_p( 2^{ord_p(2)}-1)$ odd (because $2^\ell-1$ is not a square). Don't know if this is actually helpful for your application. Jul 1, 2020 at 0:38
Felipe refers to my first ever paper (mathscinet.ams.org/mathscinet-getitem?mr=789713) from 1985 ! However I have a more recent paper that gives a better result along the lines asked for (mathscinet.ams.org/mathscinet-getitem?mr=2997580) which shows that every $$2^n-1$$, with $$n\ne1$$ or $$6$$, has a primitive prime factor that divides it to an odd power.