<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

%\usepackage[active]{srcltx}
\usepackage[shortlabels]{enumitem}

\DeclareMathOperator{\ord}{ord}
\DeclareMathOperator{\lcm}{lcm}
\def\modd#1 #2{#1\ \mbox{\rm (mod}\ #2\mbox{\rm )}}

\newcommand{\R}{{\mathbb R}}
\newcommand{\Q}{{\mathbb Q}}
\newcommand{\C}{{\mathbb C}}
\newcommand{\N}{{\mathbb N}}

%\renewcommand{\arraystretch}{1.3}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{hypothesis}[theorem]{Hypothesis}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{problem}[theorem]{Problem}

\begin{center}
\vskip 1cm{\Large\bf 
Jak\'{o}bczyk's Hypothesis on Mersenne Numbers \\
\vskip .1in
and  Generalizations of Skula's Theorem }
\vskip 1cm
Ji\v{r}\'{\i} Kla\v{s}ka\\
Institute of Mathematics\\
Faculty of Mechanical Engineering\\
Brno University of Technology\\
Technick\'{a} 2\\
CZ -- 616 69 Brno\\
Czech Republic \\
\href{mailto:klaska@fme.vutbr.cz}{\tt klaska@fme.vutbr.cz}
\end{center}

\vskip .2 in

\begin{abstract}
Recently Skula published an interesting article on the
divisibility of Mersenne numbers $2^n-1$ by powers of primes. His main
result is closely related to Jak\'{o}bczyk's  hypothesis. 
We generalize Skula's result for the numbers $a^n\pm1$
where $a\in \mathbb N$, $a\geq 2$.  
\end{abstract}

\section{Introduction}

In 1951, Polish priest and mathematician Franciszek Jak\'{o}bczyk
\cite[p.\ 127]{9} published two remarkable hypotheses concerning
Mersenne \cite[\seqnum{A000225}]{23}  and Fermat \cite[\seqnum{A000215}]{23}  numbers.  
These hypotheses can be formulated as follows.

\begin{hypothesis} \label{hyp:1}
Every Mersenne number $M_n=2^n-1$ with a prime exponent $n$ is of the
form $M_n=p_1 \cdots  p_k$ where $p_1,\ldots ,p_k$ are distinct odd
primes and $k\geq 1$. 
\end{hypothesis}

\begin{hypothesis} \label{hyp:2}
Every Fermat number $F_n=2^{2^n}+1$ with $n\in \mathbb N\cup \{0\}$ is
of the form $F_n=p_1 \cdots  p_k$ where $p_1,\ldots ,p_k$ are distinct
odd primes and $k\geq 1$. 
\end{hypothesis}


Hypotheses \ref{hyp:1} and  \ref{hyp:2} are currently among the
well-known  unresolved number theory problems. 
See, for example, \cite[p.\ 92]{21}, \cite[pp.\ 14--16]{5} and,
\cite[p.\ 160]{13}. 
A more detailed examination of the divisibility of Mersenne and Fermat
numbers led to the discovery of 
a link between  Jak\'{o}bczyk's hypotheses and the Wieferich primes
\cite[\seqnum{A001220}]{23}. 
Recall that a prime $p$  is called  Wieferich  if $2^{p-1} \equiv
\modd{1} {p^2}$. 
Wieferich primes were first introduced in 1909 in relation to the first case of Fermat's last theorem.
In the paper \cite{27} Wieferich proved that, if $p$  is an odd prime and $x^p+y^p+z^p=0$ has a solution in integers $x,y,z$ with
$p\nmid xyz$, then $2^{p-1} \equiv \modd{1} {p^2}$.
Only two Wieferich primes have been discovered so far.
The first Wieferich prime, 1093, was found by Meissner \cite{17} in 1913 and the second Wieferich prime, 3511,
was found by Beeger \cite{2} in 1922.
Whether the set $W$ of all Wieferich primes is a finite or infinite set is another unanswered question.
Recent calculations (March 2021) made under the PrimeGrid project \cite{19} have shown that, if a third Wieferich prime
exists, then its value must be greater than $3.15\times 10^{18}$.
In the following section,  we give a summary of all known results related to Wieferich primes  and Jak\'{o}bczyk's hypotheses.
Details of the life and work of Franciszek  Jak\'{o}bczyk (1905--1992) can be found  in \cite{18}.


\section{Jak\'{o}bczyk's hypotheses and Wieferich primes}



In 1964, Schinzel \cite[p.\ 102]{21} posed the following problem:
{\it Do there exist infinitely many natural numbers $n$ for which the number $M_n=2^n-1$ is not divisible by any square of
natural number $&gt;1$?} A partial answer to Schinzel's question is a result proved by Rotkiewicz \cite[p.\ 79]{20}.

\begin{theorem} \label{thm:1} {\rm (Rotkiewicz, 1965)} If there are infinitely many square-free 
Mersenne numbers, then there are infinitely many primes $p$
satisfying $2^{p-1}\not \equiv \modd{1} {p^2}$.
\end{theorem}


In 1967,  Warren and Bray \cite[p.\ 563]{24} proved the following implications:


\begin{theorem} \label{thm:2}  {\rm (Warren and Bray, 1967)} Let $n\in \mathbb N$, $n\ne 1$ and let $p,q$ be  odd primes. Then
\begin{enumerate}[\rm(i)]
\item If $p\mid  M_q$, then  $2^{(p-1)/2} \equiv \modd{1} {M_q}$.
\item  If $p\mid F_n$, then $2^{(p-1)/2} \equiv \modd{1} {F_n}$.
\end{enumerate}
\end{theorem}

The below corollary can be obtained easily from Theorem \ref{thm:2}.

\begin{corollary}  \label{cor:1}  Let $n\in \mathbb N$ and let $p,q$ be  odd primes. Then  \textup{(i)} and \textup{(ii)}  hold.
\begin{enumerate}[\rm(i)]
\item   If $p^2\mid M_q$, then $2^{p-1}\equiv \modd{1} {p^2}$.
\item  If $p^2\mid F_n$, then $2^{p-1}\equiv \modd{1} {p^2}$.
\end{enumerate}
\end{corollary}

The results presented by Warren and Bray can be extended as follows.


\begin{theorem} \label{thm:3}  Let  $n\in \mathbb N$  and let $p,q$ be  odd primes. Then  \textup{(i)} and \textup{(ii)}  hold.
\begin{enumerate}[\rm(i)]


\item If $p\mid M_q$, then $p^2\mid M_q$ if and only if $2^{p-1}\equiv \modd{1} {p^2}$.
\item  If $p\mid F_n$, then $p^2\mid F_n$ if and only if $2^{p-1}\equiv \modd{1} {p^2}$.
\end{enumerate}
\end{theorem}

See \cite[p.\ 68]{13} and, \cite[p.\ 217]{13}.
Theorem \ref{thm:3} provides the basic link between Jak\'{o}bczyk's hypotheses and Wieferich primes.
Finally, part (i) of Theorem \ref{thm:3} was generalized  by Skula \cite{22} in 2019.
Before formulating Skula's result, it may be appropriate to recall some concepts and definitions.
Let $k\in \mathbb N$ and let $p$ be a Wieferich prime. By Definition 1.4 in the paper \cite{22}, $p$ is called a
Wieferich prime of order $k$ if $q(2,p^k) \equiv \modd{0} {p^k}$
or, equivalently, $2^{p^{k-1}(p-1)} \equiv \modd{1} {p^{2k}}$.
Here, $q(2,p^k)$ means the Euler quotient of $p^k$ with base $2$. See \cite[Definition\ 1.2]{1}.
Hence, a prime $p$ is Wieferich if and only if $p$ is a Wieferich prime of order $1$.
Furthermore, note that, by \cite[Definition\ 1.3]{1}, $p$ is a Wieferich
prime of order $k$ if and only if $p^k$ is a Wieferich number with base $2$. See also \cite[\seqnum{A077816}]{23}.
Finally, let  $a,m\in \mathbb N$, $m\geq 2$  and let $\gcd(a,m)=1$. The smallest positive integer $h$
for which $a^h\equiv \modd{1} {m}$ is called the multiplicative order of $a$ modulo $m$,
which we write as $h=\ord_{m}(a)$. See \cite[p.\ 55]{15} or \cite[p.\ 17]{13}.
It is clear from Euler's theorem \cite[p.\ 55]{1} that
$\ord_{p^k}(2)$ exists for every odd prime $p$ and $k\in \mathbb N$.

Now we can  formulate the main result proved in \cite{22}.


\begin{theorem} \label{thm:4}   {\rm (Skula, 2019)} Let  $k\in
\mathbb N$  and let $p,q$ be odd primes.
If $p^k\mid M_q$, then the following statements \textup{(i)}, \textup{(ii)}  and \textup{(iii)}  are equivalent:

\begin{enumerate}[\rm(i)]
\item $p^{k+1}\mid M_q$.
\item $p$ is a Wieferich prime of order $k$.
\item $\ord_{p^{k+1}}(2)=q$.
\end{enumerate}
\end{theorem}
For an alternative proof of Theorem \ref{thm:4}  see  \cite{12}.
We conclude this section by recalling some known properties of $\ord_{m}(a)$
needed for proving our results.

\begin{proposition} \label{prop:1} Let $a,m\in \mathbb{N}$, $m\geq 2$ and let $\gcd(a,m)=1$.
Then  \textup{(i)} -- \textup{(vii)} hold.
\vskip 2mm

\begin{enumerate}[\rm(i)]

\item Let $k\in \mathbb{N}$. Then
$a^k\equiv \modd{1} {m}$  if and only if $\ord_m(a)\mid k$.

\item $\ord_m(a)\mid \varphi(m)$. Consequently, if $p$ is an odd prime, then $\ord_p(2)\mid p-1$.
Here, $\varphi$ means the Euler function.


\item Let $m=p_1^{k_1}\cdots p_s^{k_s}$ be a prime factorization of $m$. Then
$$\ord_m(a)=\lcm (\ord_{p_1^{k_1}}(a),\ldots ,\ord_{p_s^{k_s}}(a)).$$


\item Let $a,k,s\in \mathbb{N}$ and let $p$ be an odd prime satisfying $p\nmid a$.
Further, let $\ord_p(a)=h$ and let $p^s\parallel a^h-1$.  Then
\begin{displaymath} \ord_{p^k}(a)=
\begin{cases} h, &amp; \text{for $k\leq s$;}\\
       p^{k-s}h, &amp; \text{for $k&gt; s$.}
\end{cases}
\end{displaymath}
Here, $p^s\parallel a^h-1$ means that $p^s\mid a^h-1$ but $p^{s+1}\nmid a^h-1$.


\item  Let $a,k\in \mathbb{N}$ and let $p$ be an odd prime satisfying $p\nmid a$. If
$\ord_{p^{k}}(a)=h$, then $\ord_{p^{k+1}}(a)\in \{h,ph\}$.
Consequently, $\ord_{p^k}(a) \mid \ord_{p^{k+1}}(a)$.

\item Let $k\in \mathbb{N}$, $p$ be an odd prime and let $p\nmid a$.
Then  $\ord_{p^{k+1}}(a)=p^s\ord_p(a)$ for some $s\in\{0,\ldots,k\}$.


\item Let $k,s\in \mathbb{N}$, $p$ be an odd prime and let $p\nmid a$.
If $\ord_{p}(a)=\cdots=\ord_{p^k}(a)\ne \ord_{p^{k+1}}(a)$, then
$\ord_{p^{k+s}}(a)=p^s\ord_p(a)$.


\end{enumerate}
\end{proposition}

The proof of (i) and (ii)  can be found in \cite[p.\ 43]{16}. For (iii) see \cite[p.\ 30]{4}.
Part (iv) is  Theorem 4.4 proved by LeVeque in \cite[pp.\ 80--81]{15}. See also \cite[pp.\ 52--53]{16}.
Finally, (v), (vi)  and (vii) immediately follow from (iv).

\section{Some arithmetic properties of the numbers  \texorpdfstring{$a^n\pm 1$}{a^n +-1}}

In this section, we will study in more detail the arithmetic properties
of the numbers $M_n(a)=a^n-1$ and $L_n(a)=a^n+1$ where $a\in \mathbb N$, $a\geq 2$, $n\in \mathbb N \cup \{0\}$.
First, we can observe that the sequences $(M_n(a))_{n=0}^{\infty}$ and  $(L_n(a))_{n=0}^{\infty}$ are determined
by the same linear second-order recurrence formula
\begin{gather}\label{eq:31} H_{n+2}=(a+1)H_{n+1}-aH_n, \end{gather}
with suitable initial conditions $H_0,H_1\in \mathbb N\cup \{0\}$. To see this, consider
the characteristic equation   \eqref{eq:31}. We have $x^2-(a+1)x+a=(x-1)(x-a)=0$.
Hence, it follows that  Binet's formula for $H_n$ has the form
$H_n=c_1+c_2a^n$ where $H_0=c_1+c_2$ and $H_1=c_1+ac_2$. After short calculation, we obtain
\begin{gather}\label{eq:32}H_n=\frac{aH_0-H_1}{a-1}+\frac{H_1-H_0}{a-1}\; a^n.\end{gather}
If $[H_0,H_1]=[0,a-1]$, then  $H_n=M_n(a)$ by \eqref{eq:32}. If
$[H_0,H_1]=[2,a+1]$, then $H_n=L_n(a)$.
Let $m\in \mathbb N$, $m\geq 2$  and let  $\gcd(a,m)=1$. We define
\begin{align*}
M(a,m)&amp;=\min\{n\in \mathbb N: [M_n(a),M_{n+1}(a)]\equiv \modd{[0,a-1]} {m}\},\\
L(a,m)&amp;=\min\{n\in \mathbb N: [L_n(a),L_{n+1}(a)]\equiv \modd{[2,a+1]} {m}\},\\
\mu(a,m)&amp;=\min\{n\in \mathbb N: M_n(a)  \equiv \modd{0} {m}\},\\
\lambda(a,m)&amp;=\min\{n\in \mathbb N: L_n(a)  \equiv \modd{0} {m}\}.
\end{align*}

Following the customary notation of the theory of linear recurrences, we call
the numbers  $M(a,m)$ and $L(a,m)$  primitive periods of the sequences
$$\text{$(M_n(a) \bmod m)_{n=0}^{\infty}$ and  $(L_n(a) \bmod m)_{n=0}^{\infty}$.}$$
The numbers  $\mu(a,m)$ and $\lambda(a,m)$ will then be called the
rank of appearance of $m$ in $(M_n(a))_{n=0}^{\infty}$ and $(L_n(a))_{n=0}^{\infty}$ respectively.
In the following Theorem \ref{thm:5}, the basic properties of the numbers $M(a,m)$, $L(a,m)$, $\mu(a,m)$ and $\lambda(a,m)$
will be given.


\begin{theorem} \label{thm:5}   Let $a,m\in \mathbb N$, $a,m\geq 2$  and let  $\gcd(a,m)=1$. Then 
\begin{enumerate}[\rm(A)]
\item The numbers $M(a,m)$, $L(a,m)$ and $\mu(a,m)$ exist and we have
\begin{gather} \label{eq:33} M(a,m)=L(a,m)=\mu(a,m)=\ord_m(a).\end{gather}
\item Let $m\ne 2$ and let $\ord_m(a)$ be odd. Then $\lambda(a,m)$ does not exist.\\
Let  $m=2$. Then  $\lambda(a,2)=1$.
\item  Let $m\ne 2$ and let $\ord_m(a)=2t$ for some $t\in \mathbb N$. If $\lambda(a,m)$ exists,  then
\begin{gather} \label{eq:34} \lambda(a,m)=\frac{\ord_m(a)}{2}=t.\end{gather}
\item  Let $k,t\in \mathbb N$, $p$ be an odd prime and let $p\nmid a$.
Then  $$\text{$\ord_{p^k}(a)=2t$ if and only if  $\lambda(a,p^k)=t$.}$$
\end{enumerate}
\end{theorem}

\begin{proof} We prove (A). First, observe that $\ord_m(a)$ exists.
Next, it is clear that $\mu(a,m)=\min\{n\in \mathbb N: a^n\equiv \modd{1} {m}\}=\ord_m(a)$,
which means that $\mu(a,m)$ exists. Let $r=\mu(a,m)$.
Applying $\gcd(a,m)=1$, we obtain $a^r-1\equiv  \modd{0} {m}$ if and only if $a^{r+1}-1\equiv \modd{a-1} {m}$.
Hence, $M(a,m)=r$ and, thus, $M(a,m)=\mu(a,m)=\ord_m(a)$. Finally,
$[a^r-1,a^{r+1}-1] \equiv \modd{[0,a-1]} {m}$ if and only if
$[a^r+1,a^{r+1}+1]\equiv \modd{[2,a+1]} {m}$.
Hence, $M(a,m)=L(a,m)$. This proves \eqref{eq:33}.

We prove (B). Let $m\ne 2$ and suppose that $\lambda(a,m)=s$ for some $s\in \mathbb N$.
Then  $a^s\equiv \modd{-1} {m}$ and, $a^{2s}\equiv \modd{1} {m}$ follows. Hence, $\ord_m(a)\mid 2s$.
Since  $\ord_m(a)$ is odd, there exists a $t\in \mathbb N\cup \{0\}$ satisfying $\textup{ord}_m(a)=2t+1$.
This means that $2t+1\mid 2s$. Thus, there exists an $u\in \mathbb N$, $u\ne 1$ such that
$2s=u(2t+1)$. Hence, we see that $u=2v$ for some $v\in \mathbb N$ and, thus,  $s=v(2t+1)$. Therefore,
$a^s=(a^{2t+1})^v\equiv 1^v\equiv \modd{1} {m}$.
Since $a^s\equiv \modd{-1} {m}$, we have $2\equiv \modd{0} {m}$.
Hence, $m=2$,  a contradiction.

Let $m=2$. Then, it follows from $\gcd(a,2)=1$ that $a$ is odd and, thus, $2\mid a^n+1$
for every $n\in \mathbb N\cup\{0\}$. Hence,  $\lambda(a,m)=1$. This proves (B).


We prove (C). Assume that $\lambda(a,m)$ exists and that $\lambda(a,m)=s$ for some $s\in \mathbb N$.
Then  $a^s\equiv \modd{-1} {m}$ and  $a^{2s} \equiv \modd{1} {m}$ follows.
Hence, $\ord_m(a)\mid 2s$.
Since, $\ord_m(a)=2t$ we get $t\mid s$. Suppose that $t&lt;s$. Then there is a $u\in \mathbb N$, $u\ne 1$ such that
$s=tu$.
First, suppose that $u$ be even. Then we have $u=2v$ for some $v\in \mathbb N$.
Hence, $a^s=(a^{2t})^v\equiv  1^v\equiv \modd{1} {m}$.
On the other hand, $a^s\equiv \modd{-1} {m}$. Hence, $2\equiv \modd{0} {m}$.
Since $m\ne 2$, we have a contradiction.
Next, suppose that $u$ be odd. Then $u=2v+1$ for some $v\in \mathbb N\cup \{0\}$.
Hence, $a^s=a^{t(2v+1)}=(a^{2t})^va^t\equiv \modd{a^t} {m}$.
This, together with $a^s\equiv \modd{-1} {m}$, yields $a^t\equiv \modd{-1} {m}$.
Since $s=\min\{n\in \mathbb N:a^n\equiv \modd{-1} {m}\}$, we get $t\ge s$, which is a contradiction
with $t&lt;s$.
Hence, $s=t$ and  \eqref{eq:34} follows.


We prove (D). (i) First, assume that $\ord_{p^k}(a)=2t$. Therefore,
\begin{gather} \label{eq:35} a^{2t}-1=(a^t-1)(a^t+1) \equiv \modd{0} {p^k}.
\end{gather}
Let $k&gt;1$. Suppose that $a^t-1\equiv \modd{0} {p}$ and  $a^t+1\equiv \modd{0} {p}$.
Then $2\equiv \modd{0} {p}$. As $p\ne 2$, we get a contradiction. Consequently, we
have either $a^t-1\equiv \modd{0} {p^k}$ or $a^t+1\equiv \modd{0} {p^k}$.
Since the case $a^t-1\equiv \modd{0} {p^k}$ leads to a contradiction with $\ord_{p^k}(a)=2t$,
we have $a^t+1\equiv \modd{0} {p^k}$. Similarly, if $k=1$, then \eqref{eq:35}
together with $\ord_p(a)=2t$ yields $a^t+1\equiv \modd{0} {p}$.
Hence, $t\in\{n\in \mathbb N:a^n+1\equiv \modd{0} {p^k}\}$ for every $k\in \mathbb N$.
This means that  $\lambda(a,p^k)$ exists.
Applying part (C) of Theorem \ref{thm:5}, we now obtain $\lambda(a,p^k)=t$.




(ii) Conversely, assume that $\lambda(a,p^k)$ exists and that  $\lambda(a,p^k)=t$.
Then it follows from part (B) of Theorem \ref{thm:5} that $\ord_{p^k}(a)$  is even. Therefore, there is
an $s\in \mathbb N$ such that $\ord_{p^k}(a)=2s$. Hence, $a^{2s}\equiv \modd{1} {p^k}$,
which yields $(a^s-1)(a^s+1)\equiv \modd{0} {p^k}$. Using the same reasoning as in (i),
we conclude that $a^s\equiv \modd{-1} {p^k}$.
Suppose that $s\ne t$. Since   $\lambda(a,p^k)=t$, we have $s&gt;t$.
On the other hand, from $a^t\equiv \modd{-1} {p^k}$, we get  $a^{2t}\equiv \modd{1} {p^k}$, which
means that $\ord_{p^k}(a)\mid 2t$. Since  $\ord_{p^k}(a)=2s$, we have $s\mid t$, which is a contradiction with $s&gt;t$.
Hence, $s=t$. This proves (D).
\end{proof}


In the remaining part of this section, we will study the properties of the numbers $\lambda(a,m)$ in
more detail.


\begin{theorem} \label{thm:6}  Let $a,m\in \mathbb N$, $a,m\geq 2$, $2\nmid m$  and let  $\gcd(a,m)=1$. Further, let
$\ord_m(a)=2t$ for some $t\in \mathbb N$ and let $m=p_1^{k_1}\cdots p_s^{k_s}$ be a prime
factorization of $m$. Then
$\lambda(a,m)$  exists if and only if  \textup{(i)} and \textup{(ii)}  hold.
\begin{enumerate}[\rm(i)]
\item  $\lambda(a,p_i^{k_i})$ exists for   $i\in\{1,\ldots,s\}$.
\item  For  $i\in\{1,\ldots,s\}$, there is an odd $w_i\in \mathbb N$ satisfying $t=\lambda(a,p_i^{k_i})w_i$.
\end{enumerate}

In addition, if $\lambda(a,m)$ exists, then
\begin{gather}\label{eq:36} \lambda(a,m)= \lcm(\lambda(a,p_1^{k_1}),\ldots ,\lambda(a,p_s^{k_s}))=t.
\end{gather}
\end{theorem}


\begin{proof}
First, assume that $\lambda(a,m)$ exists. Then it follows that $\lambda(a,p_i^{k_i})$ exists
for every $i\in \{1,\ldots ,s\}$. Let  $t_i=\lambda(a,p_i^{k_i})$.
Applying part (D) of Theorem \ref{thm:5}, we obtain  $\ord_{p_i^{k_i}}(a)=2t_i$.
Next, using part (iii) of Proposition \ref{prop:1} , we get
\begin{gather}\label{eq:37} 2t=\ord_m(a)=\lcm (\ord_{p_1^{k_1}}(a),\ldots ,\ord_{p_s^{k_s}}(a))=2\lcm (t_1,\ldots ,t_s).
\end{gather}
Hence, $t_i\mid t$ for  $i\in \{1,\ldots ,s\}$. This means that $t=t_iw_i$ for some $w_i\in \mathbb N$.

Suppose that there is an $j\in \{1,\ldots ,s\}$ such that $2\mid w_j$. Using
$a^{t_j}\equiv \modd{-1} {p_j^{k_j}}$, we find
$a^t=(a^{t_j})^{w_j}\equiv (-1)^{w_j}\equiv \modd{1} {p_j^{k_j}}$. Suppose now that
$p_j^{k_j}\mid a^t+1$. Then $a^t\equiv \modd{-1} {p_j^{k_j}}$. This, together with
$a^t\equiv \modd{1} {p_j^{k_j}}$, yields $2\equiv \modd{0} {p_j^{k_j}}$.
Since $p_j$ is an odd prime, we have a contradiction.
Hence $p_j^{k_j}\nmid a^t+1$, which implies $m\nmid a^t+1$. Therefore, $\lambda(a,m)\ne t$.
Since $\ord_m(a)=2t$, by part (C) of Theorem \ref{thm:5}, we conclude that $\lambda(a,m)$
does not exist, which is a contradiction.


For $i\in \{1,\ldots ,s\}$,  let $w_i$ be odd.
Then $a^t=(a^{t_i})^{w_i}\equiv (-1)^{w_i}\equiv \modd{-1} {p_i^{k_i}}$.
Hence,  $p_i^{k_i}\mid a^t+1$. If  $w_i$ is odd for  $i\in \{1,\ldots ,s\}$, then
$m=p_1^{k_1}\cdots p_s^{k_s}\mid a^t+1$ and $t\in\{n\in \mathbb N:a^n+1\equiv \modd{0} {m}\}$.
This means that $\lambda(a,m)$ exists, and, using part (C) of Theorem \ref{thm:5}, we get  $\lambda(a,m)=t$.
This, together with \eqref{eq:37}, yields \eqref{eq:36}.

Conversely, assume that (i) and (ii) hold. If $t_i=\lambda(a,p_i^{k_i})$, we have
$a^{t_i}\equiv \modd{-1} {p_i^{k_i}}$.
Now we can find $a^t=(a^{t_i})^{w_i}\equiv (-1)^{w_i}\equiv \modd{-1} {p_i^{k_i}}$.
We now see that $p_i^{k_i}\mid a^t+1$ for every $i\in \{1,\ldots ,s\}$ and, thus,
$m=p_1^{k_1}\cdots p_s^{k_s}\mid a^t+1$. Hence,  $t\in\{n\in \mathbb N:a^n+1\equiv \modd{0} {m}\}$,
which means that $\lambda(a,m)$ exists. By part (C) of Theorem \ref{thm:5}, we  obtain  $\lambda(a,m)=t$.
The proof is complete.
\end{proof}


\begin{remark} \label{rem:1}
In \cite[p.\ 57]{15},   LeVeque published the following Problem 19.
\begin{gather}\label{eq:38} \text{\it Show that, if $m&gt;1$ is odd and $\ord_m(a)=2t$, then $a^t\equiv \modd{-1} {m}$.}
\end{gather}

We now prove, using a counterexample, that  LeVeque's implication  is not true. Let $m=91=7\cdot 13$
and let $a=5$. Then  $\ord_{91}(5)=12$, which means, by \eqref{eq:38},  that $t=6$.
Hence,  $5^6\equiv 64\not\equiv \modd{-1} {91}$.
It is evident that LeVeque's erroneous claim is closely related to the existence of the numbers  $\lambda(a,m)$.
By part (iii) of Proposition \ref{prop:1}, we have
$$\ord_{91}(5)=\lcm(\ord_{7}(5),\ord_{13}(5))=\lcm(6,4)=12.$$
Hence, using part (D) of Theorem \ref{thm:5}, we obtain $\lambda(5,7)=\ord_{7}(5)/2=3$ and $\lambda(5,13)=\ord_{13}(5)/2=2$.
Next, applying  Theorem \ref{thm:6}, we get $w_1=6/\lambda(5,7)=2$ and
$w_2=6/\lambda(5,13)=3$. Because $w_1$ is not odd, $\lambda(5,91)$ does not exist.
In other words, $91\nmid L_6(5)=5^6+1=2\cdot 13\cdot 601$.
\end{remark}



Let $a\in \mathbb N$, $a&gt;1$ and let $a$ be odd. Then $2\mid a+1$ and thus
$\{k\in \mathbb N: 2^k\mid a+1\}\ne \emptyset$. Put $\nu(a)=\max\{k\in \mathbb N: 2^k\mid a+1\}$.
In the following Lemma \ref{lem:1}, we show that there is a close connection between the numbers
$\nu(a)$ and $\lambda(a,2^k)$.

\begin{lemma}  \label{lem:1} Let $a,k,n\in \mathbb N$, $a&gt;1$  and let  $a$ be odd. Then
\begin{enumerate}[\rm(A)]
\item If  $2\mid n$, then $2\parallel a^n+1$.
\item If  $2\nmid n$, then $2^{\nu(a)}\parallel a^n+1$.
\item $\lambda(a,2^k)$ exist if and only if $k\leq \nu(a)$. In this case, $\lambda(a,2^k)=1$.
\end{enumerate}
\end{lemma}

\begin{proof}
We prove (A). Let $2\mid n$. Since $a&gt;1$ is odd, there is an $\alpha\in \mathbb N$ such that
$a=2\alpha+1$. Hence, using the assumption $2\mid n$ and the binomial theorem, we get
\begin{gather} \label{eq:39} a^n+1=(2\alpha+1)^n+1\equiv \modd{2} {4}.
\end{gather}
By \eqref{eq:39},  $2\parallel a^n+1$ for an even $n$.

We prove (B). Let $2\nmid n$ . Then $a^n+1=(a+1)(a^{n-1}-a^{n-2}+\cdots -a+1)$.
Since $a$ is odd, we have $2\nmid (a^{n-1}-a^{n-2}+\cdots -a+1)$. Hence, $2^s\mid a^n+1$ if and only if
$2^s\mid a+1$ for every $s\in \mathbb N$. This means that $2^{\nu (a)}\parallel a^n+1$ for any odd $n$.


Combining (A) and (B),  (C) follows immediately.
\end{proof}

Lemma \ref{lem:1} will be useful in proving Theorem \ref{thm:7}.

\begin{theorem} \label{thm:7} Let $a,M\in \mathbb N$, $a,M\geq 2$, $\gcd(a,M)=1$ and let $2\nmid a$, $2\mid M$.
Further, let $M=2^{\alpha}p_1^{\alpha_1}\cdots p_s^{\alpha_s}$ be a prime factorization of $M$ and
let $m=p_1^{\alpha_1}\cdots p_s^{\alpha_s}$.
Then \textup{(A)} and  \textup{(B)} hold.
\vskip 1mm

\begin{enumerate}[\rm(A)]
\item Let $\alpha=1$. Then $\lambda(a,M)$ exists if and only if $\lambda(a,m)$ exists.
Moreover, if $\lambda(a,M)$ exists, then $\lambda(a,M)=\lambda(a,m)$.


\item Let $\alpha &gt;1$.  Then  $\lambda(a,M)$ exists if and only if $\lambda(a,2^{\alpha})$ and $\lambda(a,m)$
exist and, $2\nmid \lambda(a,m)$. Moreover, if $\lambda(a,M)$ exists, then $\lambda(a,M)=\lambda(a,m)$.
\end{enumerate}
\end{theorem}


\begin{proof}
We prove (A). Assume that $\lambda(a,M)$ exists and that $\lambda(a,M)=U$. Then  $M\mid a^U+1$. Since $M=2m$ and $\gcd(2,m)=1$, we
get $m\mid a^U+1$, which implies that $\lambda(a,m)$ exists and that $\lambda(a,m)\leq U=\lambda(a,M)$.

Conversely, assume that $\lambda(a,m)$ exists and that $\lambda(a,m)=u$. Then $m\mid a^u+1$.
Since $a$ is odd, we have $2\mid a^n+1$ for every $n\in \mathbb N$. Hence and from $\gcd(2,m)=1$, we
obtain $M=2m\mid a^u+1$. This means that $\lambda(a,M)$ exists and that $\lambda(a,M)\leq u=\lambda(a,m)$.
This proves (A).


We prove (B). Let $\alpha&gt;1$.  First, assume that $\lambda(a,M)$ exists and that  $\lambda(a,M)=U$.
Then  $M=2^{\alpha}m\mid a^U+1$. Hence and from $\gcd(2^{\alpha},m)=1$, we obtain $2^{\alpha}\mid a^U+1$
and  $m\mid a^U+1$. This means that $\lambda(a,2^{\alpha})$ and $\lambda(a,m)$ exist.
Next, by part (C) of Lemma \ref{lem:1}, we have $\alpha\leq \nu(a)$ and, from $m\mid a^U+1$, we get  $\lambda(a,m)\leq U=\lambda(a,M)$.

Let $\lambda(a,m)=u$. Suppose that $2\mid u$.
Then, by part (A) of Lemma \ref{lem:1}, we have $2\parallel a^u+1$. This means that $2^{\alpha}\nmid a^u+1$. Hence, $M=2^{\alpha}m\nmid a^u+1$
and, thus, $\lambda(a,M)\ne u=\lambda(a,m)$. This, together with $u=\lambda(a,m)\leq U$, yields  $u&lt;U$.
Hence, $U=u+k$ for some $k\in \mathbb N$.
From $2^{\alpha}m\mid a^{u+k}+1$ and $\gcd(2^{\alpha},m)=1$, we can deduce that $m\mid a^{u+k}+1$,
or equivalently, $a^ua^k\equiv \modd{-1} {m}$. Using
$a^u\equiv \modd{-1} {m}$, we now obtain $a^k \equiv \modd{1} {m}$.
Hence, $\ord_{m}(a)\mid k$. Suppose that $\ord_{m}(a)$ is odd. Then,
by part (B) of Theorem \ref{thm:5}, $\lambda(a,m)$ does not exist, which is a contradiction.
Hence, $2\mid\ord_{m}(a)$ and, $2\mid k$ follows. Therefore,
$2\mid u+k=U$. By part (A) of Lemma \ref{lem:1}, we now obtain  $2\parallel a^U+1$.
Hence and from $\alpha &gt;1$, we get $2^{\alpha}\nmid a^U+1$, which means
$2^{\alpha}m=M\nmid a^U+1$, a contradiction.


Let $2\nmid u$. Then, by part (B) of Lemma \ref{lem:1}, we have $2^{\nu(a)}\mid a^u+1$. As
$\alpha \leq \nu(a)$, we also have $2^{\alpha}\mid a^u+1$. Hence and from $m\mid a^u+1$, we obtain
$2^{\alpha}m=M\mid a^u+1$, and  $U=\lambda(a,M)\leq u$ follows.
This, together with $u=\lambda(a,m)\leq U$, yields  $\lambda(a,M)=\lambda(a,m)$.


Conversely, assume that $\lambda(a,2^{\alpha})$ and $\lambda(a,m)$ exist and that $\lambda(a,m)$ is odd.
First, observe that, if $\alpha &gt;1$ and $\lambda(a,2^{\alpha})$ exists, then, by part (C) of Lemma \ref{lem:1}, we have
$\alpha\leq \nu(a)$ and, by part (B) of Lemma \ref{lem:1}, we have $2^{\alpha}\mid a^n+1$ for any odd $n\in \mathbb N$.
Let $\lambda(a,m)=u$. Then  $m\mid a^u+1$. Since $u$ is odd, we get  $2^{\alpha}\mid a^u+1$.
Hence and from $\gcd(2^{\alpha},m)=1$, we now obtain  $M=2^{\alpha}m\mid a^u+1$, which
means that $\lambda(a,M)$ exists and that $\lambda(a,M)\leq u$.  Put $\lambda(a,M)=U$.
Then we can write $M=2^{\alpha}m\mid a^U+1$. Since  $\gcd(2^{\alpha},m)=1$, we get $m\mid a^U+1$, which yields $\lambda(a,m)\leq U$.
Finally, combining $U=\lambda(a,M)\leq u$ with $u=\lambda(a,m)\leq U$, we get $\lambda(a,M)=\lambda(a,m)$.
This proves (B).
\end{proof}



\begin{remark} \label{rem:2}
Let us note for completeness sake that the case of $\lambda(a,m)$, where $2\mid a$ and $2\mid m$, is trivial.
Since $a^n+1$ is odd for all $n\in \mathbb N$, $\lambda(a,m)$ does not exist.
\end{remark}


Let us conclude this section with an illustrative example.


\begin{example} \label{exam:1}
Let $a=11$, $m=1769=29\cdot61$ and let $M=7076=2^2m$.
First, observe that $\ord_{29}(11)=28$, $\ord_{61}(11)=4$ and, $\ord_{1769}(11)=28$.
Applying part (D) of Theorem \ref{thm:5},  we obtain
$\lambda(11,29)=\ord_{29}(11)/2=14$ and, $\lambda(11,61)=\ord_{61}(11)/2=2$.
Next, using Theorem \ref{thm:6}, we get $t=\ord_{1769}(11)/2=14$, $w_1=14/\lambda(11,29)=1$
and, $w_2=14/\lambda(11,61)=7$. Since $w_1$ and $w_2$ are odd numbers,
$\lambda(11,1769)$ exists and, by  \eqref{eq:36}, we have  $\lambda(11,1769)=14$.
Further, observe that $2^2\mid a+1=12$. Hence, by Lemma \ref{lem:1}, $\lambda(11,2^2)$ exists and $\lambda(11,2^2)=1$.
Because $\lambda(11,1769)$ is an even number, by Theorem \ref{thm:7}, we conclude
that $\lambda(11,7076)$ does not exist.
\end{example}

\section{Mersenne numbers with base \texorpdfstring{$a$}{a}}

In this section, we generalize  Skula's result  presented in Theorem \ref{thm:4}.
Let $a,k\in \mathbb N$, $a\ge 2$ and let  $p$ be a prime
satisfying $p\nmid a$. We will call $p$ a {\it Wieferich prime of order $k$ with base $a$} if $p^k$ is a Wieferich number with base $a$. That is,
$p$ is a Wieferich prime of order $k$ with base $a$ if and only if
$$\text{$q(a,p^k) \equiv \modd{0} {p^k}$, or equivalently,  $a^{p^{k-1}(p-1)}\equiv \modd{1} {p^{2k}}$}.$$

See \cite[Definition\ 1.3]{1}.
\begin{proposition} \label{prop:2}  Let $a,k\in \mathbb N$, $a\geq 2$,  $p$ be a prime and let $p\nmid a$. Then

\begin{enumerate}[\rm(A)]

\item \text{$a^{p^{k-1}(p-1)}\equiv \modd{1} {p^{2k}}$  if and only if  $ a^{p-1}\equiv \modd{1} {p^{k+1}}$. }

\item \text{$a^{p-1}\equiv \modd{1} {p^{k+1}}$  if and only if  $\ord_{p^{k+1}}(a)=\ord_{p}(a)$.}

\item \text{$p$ is a Wieferich prime of order $k$ with base $a$ if and only if} 
$\ord_{p^{k+1}}(a)=\ord_{p}(a)$.

\end{enumerate}
\end{proposition}

\begin{proof} First, we prove (A). Assume that $a^{p^{k-1}(p-1)}\equiv \modd{1} {p^{2k}}$.
Then, by part (i) of Proposition \ref{prop:1},
\begin{gather} \label{eq:41} \ord_{p^{2k}} (a) \mid p^{k-1}(p-1). \end{gather}
Suppose that $a^{p-1}\not\equiv \modd{1} {p^{k+1}}$. Then $\ord_{p^{k+1}} (a)\ne \ord_{p} (a)$ and, by part (vi)
of Proposition \ref{prop:1}, there exists an $r\in \{1,\ldots ,k\}$ such that $\ord_{p^{k+1}} (a)=p^r \ord_{p} (a)$. Hence,
by part (vii) of Proposition \ref{prop:1}, we have
\begin{gather} \label{eq:42} \ord_{p^{2k}} (a)=p^k \ord_{p^{k+1}} (a)= p^{k+r} \ord_{p} (a). \end{gather}
Since $r\in \{1,\ldots ,k\}$  and $\ord_{p} (a)\mid p-1$, we get a contradiction by relations
\eqref{eq:41} and \eqref{eq:42}.
 
Conversely, assume that $a^{p-1}\equiv \modd{1} {p^{k+1}}$. Then $\ord_{p^{k+1}} (a)\mid p-1$, which yields
$\ord_{p} (a)=\ord_{p^{k+1}} (a)$. Hence, by part (vi) of Proposition \ref{prop:1}, there exists an
$s\in \{0,\ldots ,k-1\}$ such that
$\ord_{p^{2k}} (a)=p^s \ord_{p^{k+1}} (a)= p^s \ord_{p} (a)$.
Since $s\le k-1$,  we get $\ord_{p^{2k}} (a) \mid p^{k-1} \ord_{p} (a)$, which, together with $\ord_{p} (a)\mid p-1$,
yields $\ord_{p^{2k}} (a) \mid p^{k-1}(p-1)$. Hence, $a^{p^{k-1}(p-1)}\equiv \modd{1} {p^{2k}}$.
This proves (A).

We prove (B). Let $a^{p-1}\equiv \modd{1} {p^{k+1}}$. Then
$\ord_{p^{k+1}}(a)\mid p-1$.
Using part (vi) of Proposition \ref{prop:1},  we obtain  $\ord_{p^{k+1}}(a)=p^t\ord_{p}(a)$
for some $t\in\{0,\ldots,k\}$. If $t\ne 0$, then $p^t\ord_{p}(a)\mid p-1$, which is a contradiction.
Hence, $\ord_{p^{k+1}}(a)=\ord_{p}(a)$.

Conversely, let $\ord_{p^{k+1}}(a)=\ord_{p}(a)=u$. Then $u\mid p-1$, which means that
there exists a $v\in \mathbb{N}$ such that $p-1=uv$. Since
$a^u\equiv \modd{1} {p^{k+1}}$, we have
$a^{p-1}=a^{uv}=(a^u)^v\equiv \modd{1} {p^{k+1}}$ as required.


Finally, combining (A) and (B), we obtain (C). The proof is complete.

\end{proof}


\begin{remark} \label{rem:3}
The conclusion (A) in Proposition \ref{prop:2} also holds if $p\mid a$. In this case, of course,  we have
$a^{p^{k-1}(p-1)}\not \equiv \modd{1} {p^{2k}}$, $a^{p-1}\not\equiv \modd{1} {p^{k+1}}$
for every $a,k\in \mathbb N$, $a\geq 2$. The conclusion (B) in Proposition \ref{prop:2} also holds  for $k=0$.
\end{remark}

Now we can to prove Theorem \ref{thm:8}.

\begin{theorem} \label{thm:8}
Let  $a,k\in \mathbb{N}$, $a\geq 2$, $p,q$ be odd primes and let $p\nmid a$, $p\nmid a-1$.
If $p^{k}\mid M_q(a)$, then the following statements are equivalent:
\begin{enumerate}[\rm(A)]
\item  $p^{k+1}\mid M_q(a)$.
\item  $p$ is a Wieferich prime with base $a$ of order $k$.
\item  $\ord_{p^{k+1}}(a)=q$.
\end{enumerate}
\end{theorem}


\begin{proof}
First, we show that (A) implies (B). Let $p^{k+1}\mid M_q(a)$. Then  $a^q\equiv \modd{1} {p^{k+1}}$, which
yields $\ord_{p^{k+1}}(a)\mid q$. Since $q$ is a prime, we have $\ord_{p^{k+1}}(a)\in \{1,q\}$.
If $\ord_{p^{k+1}}(a)=1$, then $\ord_{p}(a)=1$, which means $p\mid a-1$, a contradiction. Hence, $\ord_{p^{k+1}}(a)=q$.
Suppose that $p=q$. Then  $\ord_{p^{k+1}}(a)=p$ and, using part (vi) of Proposition \ref{prop:1}, we get   $\ord_{p}(a)=1$. Hence,
$p\mid a-1$, a contradiction. Let $p\ne q$. Then, by part(vi) of Proposition \ref{prop:1}, $\ord_{p^{k+1}}(a)=p^s\ord_{p}(a)$ for
some $s\in \{0,\ldots,k\}$. Since $p\ne q$, we get $s=0$ and  $\ord_{p^{k+1}}(a)=\ord_{p}(a)=q$.
This means, by Proposition \ref{prop:2}, that $p$ is a Wieferich prime of order $k$ with base $a$.

Next, we show that (B) implies (C). Assume that  $p$ is a Wieferich prime of order $k$ with base $a$.
Then, by Proposition \ref{prop:2}, we have $2^{p-1}\equiv \modd{1} {p^{k+1}}$ and,
using part (i) of Proposition \ref{prop:1}, we get $\ord_{p^{k+1}}(a)\mid p-1$.
Next, from the basic assumption $p^k\mid M_q(a)$, we obtain $a^q\equiv \modd{1} {p^{k}}$ and $\ord_{p^{k}}(a)\mid q$ follows.
Hence, $\ord_{p^{k}}(a)\in \{1,q\}$. Suppose that $\ord_{p^{k}}(a)=1$.  Then  $p^k\mid a-1$, which yields $p\mid a-1$, a contradiction.
Hence,  $\ord_{p^{k}}(a)=q$.
Now, by part (v) of Proposition \ref{prop:1}, we have $\ord_{p^{k+1}}(a)=pq$ or $\ord_{p^{k+1}}(a)=q$.
Suppose that $\ord_{p^{k+1}}(a)=pq$. Since $\ord_{p^{k+1}}(a)\mid p-1$, we get $pq\mid p-1$, a contradiction.
Hence, (C).

Finally, we show that (C) implies (A). If $\ord_{p^{k+1}}(a)=q$, then $a^q\equiv \modd{1} {p^{k+1}}$,
which yields $p^{k+1}\mid M_q(a)$. The proof is complete.
\end{proof}

Another generalization of Theorem \ref{thm:4} provide Theorem \ref{thm:9}.

\begin{theorem} \label{thm:9} Let $a,k\in \mathbb N$, $a\geq 2$,  $p,q$ be primes and let $p\nmid a$.
Then we have $p^{k+1}\mid M_q(a)$ if and only if at least one of the below conditions
\textup{(A)}, \textup{(B)}, \textup{(C)} holds.


\vskip 2mm
\begin{enumerate}[\rm(A)]
\item $\ord_p(a)=1$, $\ord_{p^{k+1}}(a)=p$,  $p=q$.
\item $\ord_p(a)=\ord_{p^{k+1}}(a)=1$.
\item $\ord_p(a)=\ord_{p^{k+1}}(a)=q$.
\end{enumerate}
\end{theorem}


\begin{proof} (i) If $p^{k+1}\mid M_q(a)$, then $a^q\equiv \modd{1} {p^{k+1}}$, which yields
$\ord_{p^{k+1}}(a)\mid q$. Since $q$ is a prime, we have $\ord_{p^{k+1}}(a)\in \{1,q\}$.
If  $\ord_{p^{k+1}}(a)=1$, then $\ord_{p}(a)=1$ and (B) follows.
If  $\ord_{p^{k+1}}(a)=q$,  then, by part (vi) of Proposition \ref{prop:1}, we have $\ord_{p^{k+1}}(a)=p^{s}\ord_{p}(a)$ for
some $s\in \{0,\ldots,k\}$. Hence,  $p^{s}\ord_{p}(a)=q$.
Since $\ord_{p}(a)\in \mathbb N$ and  $p,q$ are  primes,  only two following cases can occur.
\vskip 1mm

Case 1: $s=1$, $\ord_{p}(a)=1$, $p=q$. Hence, (A).

Case 2: $s=0$, $\ord_{p}(a)=q$. Hence, (C).

\vskip 1mm


(ii)  The proof of a converse implication consists of three simple parts.
Assume (A). Then  $\ord_{p^{k+1}}(a)=p$ implies $a^p\equiv \modd{1} {p^{k+1}}$, which means
$p^{k+1}\mid a^p-1$.  Since $p=q$, we have  $p^{k+1}\mid a^{q}-1=M_q(a)$.
Assume (B). Then   $\ord_{p^{k+1}}(a)=1$ implies $a\equiv \modd{1} {p^{k+1}}$, thus,
$p^{k+1}\mid a-1$. Hence,  $p^{k+1}\mid (a-1)(a^{q-1}+\cdots +a+1)=a^{q}-1=M_q(a)$.
Assume (C). Then  $\ord_{p^{k+1}}(a)=q$ implies  $a^q\equiv \modd{1} {p^{k+1}}$. Hence,
$p^{k+1}\mid a^{q}-1=M_q(a)$.
\end{proof}

Applying Theorem \ref{thm:9} for $a=2$, we obtain Corollary \ref{cor:2}.

\begin{corollary} \label{cor:2} Let $k\in \mathbb N$, $p,q$ be primes and let $p\ne 2$.
Then  $p^{k+1}\mid M_q$ if and only if $\ord_{p^{k+1}} (2)=\ord_p (2)=q$. Consequently,
\begin{gather} \label{eq:43} \text{$p^2\mid M_q$ if and only if $p\in W$  and $\ord_p(2)=q$.}
\end{gather}
\end{corollary}

\begin{proof} If $p$ is a prime satisfying $\ord_{p}(2)=1$, then $2\equiv \modd{1} {p}$,
which is a contradiction. Hence, the cases (A) and (B) in Theorem \ref{thm:9}  never occur.
Part (C) in Theorem \ref{thm:9} yields $\ord_{p^{k+1}}(2)=\ord_p(2)=q$. If $k=1$,
\eqref{eq:43} follows immediately.
\end{proof}

We now show some examples demonstrating part (C) of Theorem \ref{thm:9}.


\begin{example} \label{exam:2}
(i) Let $k=1$, $a=53$, $p=47$. Then
$$\text{$\ord_{47}(53)=\ord_{47^{2}}(53)=23$ and,  $47^2\mid M_{23}(53)=53^{23}-1$.}$$
(ii) Let $k=2$, $a=6619$, $p=383$. Then
$$\text{$\ord_{383}(6619)=\ord_{383^{3}}(6619)=191$ and, $383^3\mid M_{191}(6619)=6619^{191}-1.$}$$
(iii) Let $k=3$, $a=2819$, $p=19$. Then
$$\text{$\ord_{19}(2819)=\ord_{19^{4}}(2819)=3$  and,  $19^4\mid M_{3}(2819)=2819^{3}-1$.}$$
(iv) Let $k=3$, $a=15384$, $p=71$. Then
$$\text{$\ord_{71}(15384)=\ord_{71^{4}}(15384)=7$ and,  $71^4\mid M_{7}(15384)=15384^{7}-1.$}$$
\end{example}

\section{Landry numbers with base $a$}


In this section we will refer to {\it Landry numbers with base $a$} as  the numbers
$$\text{$L_n(a)=a^n+1$  where $a\in \mathbb N, a\geq 2, n\in \mathbb N\cup \{0\}$.}$$
In particular, to numbers $L_n=L_n(2)=2^n+1$, we will refer as {\it Landry numbers}.
The term of Landry numbers we will introduce in honor of the French mathematician
Fortun\'e Landry (1799--1895), who successfully dealt with prime factorizations
of the numbers $2^n\pm 1$.
This designation has been inspired by a note presented by  Williams  \cite[p.\ 463]{26}.
Here, Williams mentions that some of Landry's results
have not received due attention being largely ignored.
For details see \cite{26}.

The main aim of this section is to show that results analogous to Theorem \ref{thm:4}
can also be proved for Landry numbers.
The following  Lemma \ref{lem:2} will be useful in proving Theorem \ref{thm:10}.

\begin{lemma} \label{lem:2} Let $k\in \mathbb N$, $p,q$ be primes and let $p\ne 2$.
Then \textup{(i)} -- \textup{(iv)} hold.
\begin{enumerate}[\rm(i)]
\item $\ord_{p^{k}}(2)\ne 1$.
\item $\ord_{p^{k}}(2)=2$ if and only if $p=3$ and $k=1$.
\item $\ord_{p^{k+1}}(2)\ne 2$.
\item If $\ord_{p^{k+1}}(2)=2q$ then, $\ord_{p}(2)\ne q$.
\end{enumerate}
\end{lemma}

The proof of Lemma  \ref{lem:2} can be left to the reader.

\begin{theorem} \label{thm:10}  Let $k\in \mathbb N$, $p,q$ be odd primes and let $p&gt;3$.
If $p^{k}\mid L_q$, then the following statements are equivalent:

\begin{enumerate}[\rm(A)]
\item $p^{k+1}\mid L_q$.
\item $p$ is a Wieferich prime of order $k$.
\item $\ord_{p^{k+1}}(2)=2q$.
\end{enumerate}

\end{theorem}
\begin{proof}
First, we prove that (A) implies (B). Let $p^{k+1}\mid L_q$. Then  we have $2^q\equiv \modd{-1} {p^{k+1}}$,
which yields $2^{2q}\equiv \modd{1} {p^{k+1}}$. Hence, $\ord_{p^{k+1}}(2)\mid 2q$.
By Lemma \ref{lem:2}, we now obtain  $\ord_{p^{k+1}}(2)=2q$.
Since $\ord_{p}(2)\mid\ord_{p^{k+1}}(2)$, we have
$\ord_{p}(2)\in \{1,2,q,2q\}$  and, by Lemma \ref{lem:2}, we get $\ord_{p}(2)=2q$.
Hence, $\ord_{p^{k+1}}(2)=\ord_{p}(2)$.
This means, by Proposition \ref{prop:2}, that  $p$ is a Wieferich prime of order $k$.

Next, we prove that (B) implies (C). Assume that $p$ is a Wieferich prime of order $k$.
Then, by Proposition \ref{prop:2}, we have
$2^{p-1}\equiv \modd{1} {p^{k+1}}$ and, by part (i) of Proposition \ref{prop:1}, we get  $\ord_{p^{k+1}}(2)\mid p-1$.
Next, from the basic assumption $p^k\mid L_q$, we obtain $2^q\equiv \modd{-1} {p^{k}}$, which yields
$2^{2q}\equiv \modd{1} {p^{k}}$. Hence, $\ord_{p^{k}}(2)\mid 2q$ and, by Lemma \ref{lem:2},
we obtain $\ord_{p^{k}}(2)=2q$.
Further, by part (v) of Proposition \ref{prop:1}, we get $\ord_{p^{k+1}}(2)\in \{2q, 2pq\}$.
Suppose that $\ord_{p^{k+1}}(2)=2pq$.
Since $\ord_{p^{k+1}}(2)\mid p-1$, we get $2pq\mid p-1$, a contradiction.
Hence, $\ord_{p^{k+1}}(2)=2q$.

Finally, we prove that (C) implies (A). Assume, that  $\ord_{p^{k+1}}(2)=2q$.
Then $2^{2q}\equiv \modd{1} {p^{k+1}}$
yielding $p^{k+1}\mid (2^q-1)(2^q+1)$. Suppose that $p\mid 2^q-1$. Then we have $\ord_{p}(2)\mid q$,
which means that $\ord_{p}(2)\in\{1,q\}$.
Hence, by Lemma \ref{lem:2}, a contradiction follows.
Therefore, $p^{k+1}\mid 2^q+1=L_q$. The proof is complete.
\end{proof}

For Landry numbers with a base $a\in \mathbb N$, $a\geq 2$, we can prove the following theorem.

\begin{theorem}  \label{thm:11} Let $a,k\in \mathbb N$, $a\geq 2$, let $p,q$ be odd primes, and let $p\nmid a$.
Then  $p^{k+1}\mid L_q(a)$ if and only if at least one of the below conditions \textup{(A)}, \textup{(B)}, \textup{(C)} holds.


\begin{enumerate}[\rm(A)]
\item $\ord_p(a)=2$, $\ord_{p^{k+1}}(a)=2p$,  $p=q$.
\item $\ord_p(a)=\ord_{p^{k+1}}(a)=2$.
\item $\ord_p(a)=\ord_{p^{k+1}}(a)=2q$.
\end{enumerate}

\end{theorem}

\begin{proof} (i) Let $p^{k+1}\mid L_q(a)$. Then  $a^q\equiv \modd{-1} {p^{k+1}}$, which yields $\ord_{p^{k+1}}(a)\ne q$.
On the other hand, the congruence $a^q\equiv \modd{-1} {p^{k+1}}$ implies $a^{2q}\equiv \modd{1} {p^{k+1}}$.
Hence, $\ord_{p^{k+1}}(a)\mid 2q$. Since $q$ is an odd prime, we have $\ord_{p^{k+1}}(a)\in \{1,2,2q\}$.
Next, by part (vi) of Proposition \ref{prop:1}, there exists an $s\in \{0,\ldots,k\}$ such that
$\ord_{p^{k+1}}(a)=p^s\ord_{p}(a)$. Hence, $p^s\ord_{p}(a)\mid 2q$.

Let $s\ne 0$. Since $p,q$ are odd primes, the relation $p^s\ord_{p}(a)\mid 2q$
implies $s=1$, $p=q$ and $\ord_p(a)\mid 2$. Hence, $\ord_p(a)\in \{1,2\}$.
Suppose that $\ord_p(a)=1$. Then  $\ord_{p^{k+1}}(a)=p$, which means that $a^p\equiv \modd{1} {p^{k+1}}$.
Since we have $p=q$, it follows from $p^{k+1}\mid L_q(a)$ that $a^p\equiv \modd{-1} {p^{k+1}}$. Combining
$a^p\equiv \modd{1} {p^{k+1}}$ and $a^p\equiv \modd{-1} {p^{k+1}}$, we obtain
$2\equiv \modd{0} {p^{k+1}}$, a contradiction. If  $\ord_p(a)=2$, then
$\ord_{p^{k+1}}(a)=2p=2q$. Hence, (A).

Let $s=0$. Then  we have $\ord_{p^{k+1}}(a)=\ord_{p}(a)$. Suppose that $\ord_{p^{k+1}}(a)=1$.
Then  $p^{k+1}\mid a-1$. Hence,  $p^{k+1}\mid (a-1)(a^{q-1}+\cdots +a+1)=a^q-1$, which yields
$a^q\equiv \modd{1} {p^{k+1}}$. On the other hand, from $p^{k+1}\mid L_q(a)$,
it follows $a^q\equiv \modd{-1} {p^{k+1}}$. Along with $a^q\equiv \modd{1} {p^{k+1}}$, this yields
$2\equiv \modd{0} {p^{k+1}}$, a contradiction.
Finally, if $\ord_{p^{k+1}}(a)=2$, we get (B) and, if  $\ord_{p^{k+1}}(a)=2q$, we get (C).



(ii) The proof of the converse implication consists of the three following parts.

 Assume (A). From  $\ord_{p^{k+1}}(a)=2p$, it follows that $p^{k+1}\mid a^{2p}-1=(a^p-1)(a^p+1)$.
Suppose that $p\mid a^p-1$. Then  $\ord_{p}(a)\in \{1,p\}$, which is a contradiction with
$\ord_{p}(a)=2$. Hence, $p^{k+1}\mid a^p+1$. Since $p=q$, we have $p^{k+1}\mid a^q+1=L_q(a)$.

Assume (B). From  $\ord_{p^{k+1}}(a)=2$, it follows that $p^{k+1}\mid a^2-1=(a-1)(a+1)$.
Suppose that $p\mid a-1$. Then  we have $\ord_{p}(a)=1$, which is a contradiction with $\ord_{p}(a)=2$.
Hence, $p^{k+1}\mid a+1$, which yields $p^{k+1}\mid (a+1)(a^{q-1}-a^{q-2}+\cdots -a+1)=a^q+1=L_q(a)$.

Assume (C). From  $\ord_{p^{k+1}}(a)=2q$, it follows that $p^{k+1}\mid a^{2q}-1=(a^q-1)(a^q+1)$.
Suppose that $p\mid a^q-1$. Then  $\ord_{p}(a)\in \{1,q\}$, which is a contradiction with
$\ord_{p}(a)=2q$. Hence, $p^{k+1}\mid a^q+1=L_q(a)$.
\end{proof}

Applying Theorem \ref{thm:11} for $a=2$ and $k=1$, we obtain Corollary \ref{cor:3}.


\begin{corollary} \label{cor:3} Let $p,q$ be an odd primes. Then  $p^2\mid L_q$ if and only if
\begin{gather} \label{eq:51}  \text{$[p,q]=[3,3]$  or $\ord_p (2)= \ord_{p^2} (2)=2q$}.
\end{gather}
Consequently, if $p&gt;3$, then
\begin{gather} \label{eq:52} \text{$p^2\mid L_q$  if and only if $p\in W$  and  $\ord_p(2)=2q$}.
\end{gather}
\end{corollary}

\begin{proof} Let $p$ be an odd prime satisfying $\ord_p(2)=2$. Then  $2^2\equiv \modd{1} {p}$,
which yields $p=3$. Since $\ord_9(2)=6$, part (A) in Theorem \ref{thm:11} is equivalent to $[p,q]=[3,3]$ and part
(B) will never occur. Next, part (C) of Theorem \ref{thm:11} yields $\ord_p (2)= \ord_{p^2} (2)=2q$.
Hence,  \eqref{eq:51}. Finally,  \eqref{eq:52} immediately follows from  \eqref{eq:51} and Proposition \ref{prop:2}.
\end{proof}

We now demonstrate part (C) of Theorem \ref{thm:11} by some examples.

\begin{example} \label{exam:3}
(i) Let $k=1$, $a=79$, $p=263$. Then
$$\text{$\ord_{263}(79)=\ord_{263^{2}}(79)=2\cdot 131$ and, $263^2\mid L_{131}(79)=79^{131}+1$.}$$
(ii) Let $k=2$, $a=42$, $p=23$. Then
$$\text{$\ord_{23}(42)=\ord_{23^{3}}(42)=2\cdot 11$ and, $23^3\mid L_{11}(42)=42^{11}+1$.}$$
(iii) Let $k=3$, $a=119551$, $p=107$. Then
$$\text{$\ord_{107}(119551)=\ord_{107^{4}}(119551)=2\cdot 53$ and,  $107^4\mid L_{53}(119551)=119551^{53}+1$.}$$
(iv) Let $k=1$, $a=26$, $p=6695256707$. Then
$$\text{$\ord_{p}(26)=\ord_{p^{2}}(26)=2q,q=3347628353$ and, $6695256707^2\mid L_{q}(26)=26^{q}+1$.}$$

Note, that the number $26^q+1$ has $4 736 804 899$ digits. This can be verified
using the formula $N=\lfloor \log_{10}(n)+1\rfloor$. Here, $N$ stands for the number of digits of $n$ and
$\lfloor  \cdot \rfloor$ denotes the floor function.
\end{example}



\begin{remark} \label{rem:4}
After a brief inspection of the proof of Theorem \ref{thm:11}, we see that its conclusion
cannot be true for $q$ having a value of $2$.
Namely, if $q=2$, then (B) does not imply  $p^{k+1}\mid L_q(a)$. To see this, assume (B).
Then  $\ord_{p^{k+1}} (a)=2$, which means $a^2\equiv \modd{1} {p^{k+1}}$.
Suppose that $p^{k+1}\mid L_2(a)$. Then  $a^2\equiv \modd{-1} {p^{k+1}}$.
This, together with $a^2\equiv \modd{1} {p^{k+1}}$, yields
$2\equiv \modd{0} {p^{k+1}}$, a contradiction.
It is worth noting that all the remaining implications in Theorem \ref{thm:11} are also
true for $q=2$.
\end{remark}



\begin{theorem} \label{thm:12} Let $a,k\in \mathbb N$, $a&gt;2$, $2\nmid a$ and let $q$ be a prime.
Then \textup{(A)} and \textup{(B)} hold.

\begin{enumerate}[\rm(A)]
\item Let $q\ne 2$. Then  $2^{k+1}\mid L_q(a)$ if and only if $2^{k+1}\mid L_1(a)$.
\item Let $q= 2$. Then  $2^{k+1}\nmid L_2(a)$.
\end{enumerate}
\end{theorem}
\begin{proof} We prove (A). First, using the assumption $q\ne 2$, we obtain
\begin{gather} \label{eq:53}
L_q(a)=L_1(a)(a^{q-1}-a^{q-2}+\cdots -a+1).
\end{gather}

Next, applying $2\nmid a$ and $2\nmid q$, we get $2\nmid (a^{q-1}-a^{q-2}+\cdots -a+1)$.
This, together with \eqref{eq:53}, yields (A).

We prove (B). Since $a&gt;2$ and $2\nmid a$, there exists an $\alpha\in \mathbb N$ such that $a=2\alpha+1$.
Hence, $a^2+1=2(2\alpha^2+2\alpha+1)$. This  means that $4\nmid a^2+1$ and, $2^{k+1}\nmid L_2(a)$ follows.
\end{proof}

We conclude this section by Hypothesis \ref{hyp:3}.


\begin{hypothesis}  \label{hyp:3} {\it Every Landry number $L_n=2^n+1$ with a prime exponent $n&gt;3$ is of the form
$L_n=p_1 \cdots  p_k$ where $p_1,\ldots ,p_k$ are distinct odd primes and $k\geq 1$.}
\end{hypothesis}




\section{Some problems related to \texorpdfstring{$\ord_p (2)$}{ord_p 2}}

We start this section by recalling some known properties of the quadratic character of $2$.

\begin{theorem} \label{thm:13} Let $p$ be a prime, $p\ne 2$. Then
\begin{gather} \label{eq:61} \left( \frac {2} {p} \right)\equiv \modd{2^{\frac{p-1}{2}}} {p}\end{gather}
and,
\begin{gather} \label{eq:62}
\left( \frac {2} {p} \right)=(-1)^{\frac{p^2-1}{8}}=
\begin{cases}  1, &amp; \text{if $p\equiv  \modd{1,7} {8}$;}\\
              -1, &amp; \text{if $p\equiv  \modd{3,5} {8}$.}
\end{cases}
\end{gather}
\end{theorem}




For a proof of  \eqref{eq:61} see, for example, \cite[p.\ 86]{6} or \cite[p.\ 51]{8}.
An elementary proof of \eqref{eq:62}, based on Gauss's lemma, can be found in books \cite[p.\ 53]{8} and \cite[p.\ 102]{15}.
For some alternative proofs of  \eqref{eq:62}, consult articles \cite{10} and \cite{25}.

\begin{proposition} \label{prop:3}
Let $p$ be a prime, $p\ne 2$ and let $\ord_p(2)=q$, where $q$ is a prime.  Then
\begin{gather} \label{eq:63} \text{$p=3$ or  $p\equiv \modd{1,7} {8}$.}\end{gather}
\end{proposition}

\begin{proof} If $q=2$, then $\ord_p(2)=2$.
Hence, $3\equiv \modd{0} {p}$ and $p=3$ follows. Let $q\ne 2$.
Since $q\mid p-1$, there exists a $u\in \mathbb N$ such that $p-1=2qu$. Hence,
$2^{(p-1)/2}=(2^q)^u\equiv 1^u\equiv \modd{1} {p}$.
Applying \eqref{eq:61}  and  \eqref{eq:62}, we now obtain  $p\equiv \modd{1,7} {8}$.
\end{proof}

The below example illustrates that, in \eqref{eq:63}, both cases $p\equiv \modd{1,7} {8}$
can occur.

\begin{example} \label{exam:4}
(i) Let $p=89$.  Then  $p\equiv \modd{1} {8}$  and we have  $\ord_{89}(2)=11$.
(ii) Let $p=7$.  Then  $p\equiv \modd{7} {8}$  and we have  $\ord_{7}(2)=3$.
The values of the primes $p$ presented are the least values for which the corresponding
cases occur.
\end{example}
\begin{proposition} \label{prop:4}
Let $p$ be a prime, $p\ne 2$ and let $\ord_p(2)=2q$, where $q$ is a prime. Then  \textup{(i)} and \textup{(ii)} hold:
\begin{enumerate}[\rm(i)]
\item  $p\ne 8k+5$ for any $k\in \mathbb N$.

\item $p\ne 8k+7$ for any $k\in \mathbb N$.
\end{enumerate}
\end{proposition}

\begin{proof}
First observe that, if $q=2$, then $\ord_p(2)=4$ and, thus,
$15\equiv \modd{0} {p}$. Hence,  $p=3$ or $p=5$, which yields
a contradiction in both cases (i) and (ii).


To prove (i), let $q\ne 2$.  Suppose that $p=8k+5$ for some $k\in \mathbb N$. Then, by  Theorem \ref{thm:13},
$(2/p)\equiv 2^{(p-1)/2}\equiv \modd{-1} {p}$.
Since $2q\mid p-1$, there exists a  $u\in \mathbb N$ such that $p-1=2qu$. Hence,
\begin{gather} \label{eq:64} 2^{qu}=2^{(p-1)/2}\equiv \modd{-1} {p}. 
\end{gather}
Next, it is clear from $\ord_p(2)=2q$ that $2^{2q}\equiv \modd{1} {p}$. Hence,
$2^{q}\equiv \modd{-1} {p}$. Suppose that $u$ is even. Then
\begin{gather} \label{eq:65}
2^{qu}=(2^q)^u\equiv (-1)^u\equiv \modd{1} {p}. 
\end{gather}
Combining  \eqref{eq:64} and  \eqref{eq:65} we  obtain $2\equiv \modd{0} {p}$.
Hence, $p=2$, a contradiction.

Suppose that $u$ is odd. Then  $u=2v+1$ for some $v\in  \mathbb N\cup \{0\}$. From
$p-1=2qu$, it follows that $p=4qv+2q+1$, which yields
$p\equiv \modd{2q+1} {4}$. On the other hand, using the assumption $p=8k+5$, we get
$p\equiv \modd{1} {4}$. This, together with $p\equiv \modd{2q+1} {4}$,
yields $q\equiv \modd{0} {2}$.
Hence, $q=2$, a contradiction. This proves (i).

The proof of (ii) is similar.
\end{proof}

From Proposition \ref{prop:4}, we immediately obtain Corollary \ref{cor:4}.

\begin{corollary} \label{cor:4}
Let $p$ be a prime, $p\ne 2$ and let $\ord_p(2)=2q$, where $q$ is a prime. Then
\begin{gather} \label{eq:66} \text{$p=5$  or $p\equiv \modd{1,3} {8}$}.\end{gather}
\end{corollary}


The below example illustrates that, in \eqref{eq:66}, both cases $p\equiv \modd{1,3} {8}$
can occur.

\begin{example} \label{exam:5}
(i) Let $p=1049$.  Then  $p\equiv \modd{1} {8}$  and we have  $\ord_{1049}(2)=2\cdot 131$.
(ii) Let $p=11$.  Then  $p\equiv \modd{3} {8}$  and we have  $\ord_{11}(2)=2\cdot 5$.
The values of the primes $p$  presented are the least values for which the corresponding cases occur.
\end{example}

In the remaining part of this section, the following notation
will be adopted. If $A$ is a finite set, $\#A$ denotes the number of elements of $A$.
Next, $P$ denotes the set of all odd primes. Finally, for an $n\in \mathbb N$, we define
\begin{align*}
\pi(n)&amp;=\# \{p\in  P\cup \{2\}: p\leq n\},\\
E(n)&amp;=\# \{\text{$p\in P: p\le n, \ord_p (2)$ is even}\},\\
O(n)&amp;=\# \{\text{$p\in P: p\le n, \ord_p (2)$ is odd}\},\\
Q(n)&amp;=\# \{p\in P: p\le n, \ord_p (2)=q,  q\in  P\cup \{2\}\},\\
T(n)&amp;=\# \{p\in P: p\le n, \ord_p (2)=2q, q\in P\cup \{2\} \}.
\end{align*}

Computer investigation of the values $E(n)$, $O(n)$, $Q(n)$, $T(n)$ and
$\pi(\pi(n))$ for $n\leq 10^{10}$ yields the data in Table~\ref{tab1}:
\begin{table}[H]
\begin{center}
\begin{tabular}{c|cccccc}
$n$              &amp;  $E(n)$            &amp; $O(n)$        &amp; $Q(n)$           &amp; $T(n)$       &amp;   $\pi(n)$     &amp; $\pi(\pi(n))$  \\
\hline
$10^2$           &amp;  16              &amp; 8           &amp; 6              &amp; 5          &amp;    25        &amp;  9           \\
$10^3$           &amp;  117             &amp; 50          &amp; 22             &amp; 17         &amp;    168       &amp;  39          \\
$10^4$           &amp;  878             &amp; 350         &amp; 106            &amp; 96         &amp;    1229      &amp;  201         \\
$10^5$           &amp;  6794            &amp; 2797        &amp; 586            &amp; 590        &amp;    9592      &amp;  1184        \\
$10^6$           &amp;  55550           &amp; 22947       &amp; 3846           &amp; 3745       &amp;    78498     &amp;  7702        \\
$10^7$           &amp;  470633          &amp; 193945      &amp; 26561          &amp; 26596      &amp;    664579    &amp;  53911       \\
$10^8$           &amp;  4081095         &amp; 1680359     &amp; 196652         &amp; 196695     &amp;    5761455   &amp;  397557      \\
$10^9$           &amp;  36016626        &amp; 14830907    &amp; 1511508        &amp; 1509239    &amp;    50847534  &amp;  3048955     \\
\ $10^{10}$      &amp;  322328955       &amp; 132723555   &amp; 11982381       &amp; 11981476   &amp;    455052511 &amp;  24106415    
\end{tabular}
\end{center}
\caption{Some values of $E(n)$, $O(n)$, $Q(n)$, $T(n)$ and
$\pi(\pi(n))$.}
\label{tab1}
\end{table}



From Table~\ref{tab1}, we immediately obtain
\begin{gather} \label{eq:68}
\text{ $\frac{E(10^{10})}{\pi(10^{10})}\doteq 0.708333$, $\frac{O(10^{10})}{\pi(10^{10})}\doteq 0.291666$
and $ \frac{O(10^{10})}{E(10^{10})}\doteq 0.411764$.}
\end{gather}

The relations given in \eqref{eq:68} reveal a significant difference between the numbers $E(n)$ and $O(n)$ in the investigated range.
In fact, in 1966, Hasse,  \cite[p.\ 23]{7}  proved that
\begin{gather}\label{eq:69}
\text{$\lim_{n\to\infty}\frac{E(n)}{\pi(n)}=\frac{17}{24}$, $\lim_{n\to\infty}\frac{O(n)}{\pi(n)}=\frac{7}{24}$
and $\lim_{n\to\infty}\frac{O(n)}{E(n)}=\frac{7}{17}$.}
\end{gather}
See also Lagarias \cite[p.\ 449]{14}. Furthermore, from  Table~\ref{tab1}, we obtain
\begin{gather} \label{eq:610}
\text{$\frac{Q(10^{10})}{T(10^{10})}\doteq 1.000075$  and $\frac{\pi(\pi(10^{10}))}{Q(10^{10})}\doteq 2.011821$.}
\end{gather}
This leads to a natural question, which can be formulated as Problem \ref{prob:1}.
\begin{problem} \label{prob:1} Prove or disprove
\begin{gather}\label{eq:611} \text{$\lim_{n\to\infty}\frac{Q(n)}{T(n)}=1$ and
$\lim_{n\to\infty}\frac{\pi(\pi(n))}{Q(n)}=2$.}
\end{gather}
\end{problem}

Next, for an $n\in \mathbb N$, let us define
\begin{align*}
R(n)&amp;=\#\{p\in P: p\le n, \ord_p (2)=q, q\in P\cup\{2\}, p\equiv \modd{1} {8}\},\\
S(n)&amp;=\#\{p\in P: p\le n, \ord_p (2)=q, q\in P\cup\{2\}, p\equiv \modd{7} {8}\},\\
U(n)&amp;=\#\{p\in P: p\le n, \ord_p (2)=2q, q\in P\cup \{2\}, p\equiv \modd{1} {8}\},\\
V(n)&amp;=\#\{p\in P: p\le n, \ord_p (2)=2q, q\in P\cup \{2\}, p\equiv \modd{3} {8}\}.
\end{align*}

Computer investigation of the values $R(n)$, $S(n)$, $U(n)$, and $V(n)$ for $n\leq 10^{10}$, yields the data in Table~\ref{tab2}. 

\begin{table}[H]
\begin{center}
\begin{tabular}{c|cccc}
$n$          &amp;  $R(n)$          &amp; $S(n)$               &amp; $U(n)$       &amp; $V(n)$         \\
\hline
$10^2$       &amp;  1             &amp; 4                  &amp; 0          &amp;  4           \\
$10^3 $      &amp;  2             &amp; 19                 &amp; 0          &amp;  16          \\
$10^4  $     &amp;  13            &amp; 92                 &amp; 18         &amp;  77          \\
$10^5   $    &amp;  92            &amp; 493                &amp; 95         &amp;  494         \\
$10^6    $   &amp;  629           &amp; 3216               &amp; 594        &amp;  3150        \\
$10^7     $  &amp;  4182          &amp; 22378              &amp; 4320       &amp;  22275       \\
$10^8      $ &amp;  30556         &amp; 166095             &amp; 30961      &amp;  165733      \\
$10^9       $&amp;  233384        &amp; 1278123            &amp; 233357     &amp;  1275881     \\
\ $10^{10}$  &amp;  1834805       &amp; 10147575           &amp; 1835943    &amp;  10145532    
\end{tabular}
\end{center}
\caption{Some values of $R(n)$, $S(n)$, $U(n)$, and $V(n)$.}
\label{tab2}
\end{table}

From  Tables~\ref{tab1}  and \ref{tab2}, we get
$$
\text{$\frac{R(10^{10})}{Q(10^{10})}\doteq 0.153125$, $\frac{S(10^{10})}{Q(10^{10})}\doteq 0.846874$  and $\frac{R(10^{10})}{S(10^{10})}\doteq 0.180812$.}
$$

$$
\text{$\frac{U(10^{10})}{T(10^{10})}\doteq 0.153231$,  $\frac{V(10^{10})}{T(10^{10})}\doteq 0.846768$ and $\frac{U(10^{10})}{V(10^{10})}\doteq 0.180960$.}
$$
Hence, we can propose the following problem.

\begin{problem} \label{prob:2} Find the limits \eqref{eq:613}  and \eqref{eq:614}  and prove that $\alpha_i=\beta_i$ for  $i\in\{1,2,3\}$.
\begin{gather}\label{eq:613}
\text{$\alpha_1=\lim_{n\to\infty}\frac{R(n)}{Q(n)}$, $\alpha_2=\lim_{n\to\infty}\frac{S(n)}{Q(n)}$ and $\alpha_3=\lim_{n\to\infty}\frac{R(n)}{S(n)}$.}
\end{gather}
\begin{gather}\label{eq:614}
\text{$\beta_1=\lim_{n\to\infty}\frac{U(n)}{T(n)}$, $\beta_2=\lim_{n\to\infty}\frac{V(n)}{T(n)}$ and $\beta_3=\lim_{n\to\infty}\frac{U(n)}{V(n)}$.}
\end{gather}
\end{problem}


\section{Concluding remarks}

The following  questions play an important role in further
investigating the problem of the existence of primes $p,q$ satisfying
$p^2\mid 2^q\pm 1$. Is there a third Wieferich prime? Is the set $W$ of all
Wieferich primes finite or infinite?
Opinions vary as to what are the correct answers to such questions.
See, for example, Beeger \cite[p.\ 52]{3} and Guy \cite[p.\ 14]{5}.
If Beeger's point of view is right, that is,  $W=\{1093, 3511\}$,
then both  Hypothesis \ref{hyp:1} and Hypothesis \ref{hyp:3} hold.
This follows immediately from \eqref{eq:71} and \eqref{eq:72}.
\begin{gather} \label{eq:71} \ord_{1093}(2)=\ord_{1093^2}(2)=364=2^2\cdot 7\cdot 13,\end{gather}
\begin{gather} \label{eq:72}   \ord_{3511}(2)=\ord_{3511^2}(2)=1755=3^3\cdot 5\cdot 13.\end{gather}

On the other hand, by \eqref{eq:43} and \eqref{eq:52}, both hypotheses may hold true even if the set $W$ is infinite.
This fact makes both problems even more interesting.

It is worth noting that a similar disunity of opinion can also be seen
in the analogous problem concerning  the existence of Wall-Sun-Sun primes.
A detailed historical study of this problem can be found in the article \cite{11}.

In conclusion, let us note that a statement similar to \eqref{eq:43} and \eqref{eq:52} can also be proved
for Fermat numbers as shown below.

\begin{theorem} \label{thm:14} Let $n\in \mathbb N\cup \{0\}$ and let $p$ be a prime. Then
\begin{gather} \label{eq:73}
\text{$p^2\mid F_n$ if and only if $p\in W$  and $\ord_p(2)=2^{n+1}$.}
\end{gather}
\end{theorem}


Using a computer, it can be verified that, for $p\leq 10^{10}$, there exist only $20$  primes satisfying
$\ord_p(2)=2^{k}$ for some $k\in \mathbb N$:
$$3, 5, 17, 257, 641, 65537, 114689, 274177, 319489, 974849, 2424833, 6700417, 13631489,$$
$$26017793, 45592577, 63766529, 167772161, 825753601, 1214251009, 6487031809.$$


\section{Acknowledgment}

The author thanks the  anonymous referee for carefully reading  the manuscript.

\begin{thebibliography}{27}
\bibitem{1}
T. Agoh, K. Dilcher, and L. Skula, Fermat quotients for composite moduli,
\textit{J. Number Theory} \textbf{66} (1997), 29--50.
\bibitem{2}
N. Beeger, On a new case of the congruence $2^{p-1}\equiv 1\; ({\rm mod}\; p^2)$, \textit{Messenger of Mathematics} \textbf{51} (1922), 149--150.
\bibitem{3}
N. Beeger, On the congruence $2^{p-1}\equiv 1\; ({\rm mod}\; p^2)$ and Fermat's last theorem, \textit{Nieuw Arch. Wiskunde} \textbf{20} (1939), 51--54.
\bibitem{4}
E. Deza, \emph{Mersenne Numbers and Fermat Numbers, Selected Chapters of Number Theory: Special Numbers}, World Scientific, 2021.
\bibitem{5}
R. K. Guy, \emph{Unsolved Problems in Number Theory}, 3rd edition, Springer, 2004.
\bibitem{6}
G. H. Hardy and E. M. Wright, \emph{An Introduction to the Theory of Numbers}, 6th edition, Oxford University Press,  2008.
\bibitem{7}
H. Hasse, \"{U}ber die Dichte der Primzahlen $p$, f\"{u}r die eine vorgegebene ganzrationale Zahl $a\ne 0$ von gerader  bzw.\ ungerader
Ordnung mod.$p$ ist, \textit{Math. Ann.} \textbf{166} (1966),  19--23.
\bibitem{8}
K. Ireland and M. Rosen, \emph{A Classical Introduction to Modern Number Theory}, 2nd edition, Springer, 1992.
\bibitem{9}
F. Jak\'{o}bczyk, Les applications de la fonction $\lambda_g(n)$
\`{a} l'\'{e}tude des fractions p\'{e}riodiques et de la congruence chinoise
$2^n-2\equiv 0\; ({\rm mod}\; n)$, \textit{Ann. Univ. Mariae Curie-Sk\l odowska} \textbf{5} (1951), 97--138.
\bibitem{10}
R. Jakimczuk, The quadratic character of $2$, \textit{Math. Mag.}  \textbf{84} (2011), 126--127.
\bibitem{11}
J. Kla\v{s}ka, Donald Dines Wall's conjecture, \textit{Fibonacci Quart.} \textbf{56} (2018), 43--51.
\bibitem{12}
J. Kla\v{s}ka, A simple proof of Skula's theorem on prime power divisors of Mersenne numbers,
\textit{J. Integer Sequences} \textbf{25} (2022), 
\href{https://cs.uwaterloo.ca/journals/JIS/VOL25/Klaska/klaska2.html}{Article 22.4.3}.
\bibitem{13}
M. K\v{r}\'{i}\v{z}ek, F. Luca, and L. Somer, \emph{$17$ Lectures on Fermat Numbers, From Number Theory to Geometry}, Canadian Mathematical Society, Springer, 2001.
\bibitem{14}
J. C. Lagarias, The set of primes dividing the Lucas numbers has density $2/3$, \textit{Pacific J. Math.} \textbf{118} (1985), 449--461.
\bibitem{15}
W. J. LeVeque, \emph{Fundamentals of Number Theory}, Addison-Wesley, 1977.
\bibitem{16}
W. J. LeVeque, \emph{Topics in Number Theory}, Volume I, Dover Publications, 2002.
\bibitem{17}
W. Meissner, \"{U}ber die Teilbarkeit von $2^p-2$ durch das Quadrat der Primzahl $p=1093$,
\textit{Sitzungsberichte der  Akademie der Wissenschaften} \textbf{35} (1913), 663--667.
\bibitem{18}
H. Piersa, \'{S}p. Ksi\c{a}dz dr Franciszek Jak\'{o}bczyk (9 X 1905--3 VI 1992), \textit{Roczniki Filozoficzne} \textbf{39--40},  (1991--1992), 5--7.
\bibitem{19}
PrimeGrid, \url{https://www.primegrid.com}.
\bibitem{20}
A. Rotkiewicz, Sur les nombres de Mersenne d\'epourvus de diviseurs 
carr\'es et sur les nombres naturels $n$, tels que $n^2\mid2^n-2$, 
\textit{Mat. Vestnik} \textbf{17} (1965), 78--80.
\bibitem{21}
W. Sierpi\'{n}ski, \emph{A Selection of Problems in the Theory of Numbers}, Pergamon Press,  1964.
\bibitem{22}
L. Skula, Prime power divisors of Mersenne numbers and Wieferich primes of higher order, \textit{Integers} \textbf{19} (2019), \#A19.
\bibitem{23}
N. J. A. Sloane et al., \emph{The On-Line Encyclopedia of Integer Sequences}, available at \url{https://oeis.org}, 2023.
\bibitem{24}
L. R. Warren and H. G. Bray, On the square-freeness of Fermat and Mersenne numbers, \textit{Pacific J. Math.} \textbf{22} (1967), 563--564.
\bibitem{25}
K. S. Williams, The quadratic character of $2 \bmod p$, \textit{Math. Mag.} \textbf{49} (1976), 89--90.
\bibitem{26}
K. S. Williams, How was $F_6$ factored?, \textit{Math.  Comp.} \textbf{61} (1993), 463--474.
\bibitem{27}
A. Wieferich, Zum letzten Fermat'schen Theorem, \textit{J.  Reine Angew. Math.} \textbf{136} (1909), 293--302.
\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2020 {\it Mathematics Subject Classification:}
Primary 11A41; Secondary 11A07.

\noindent \emph{Keywords:} 
Mersenne number, Fermat number, Wieferich prime, Wieferich number.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences
\seqnum{A000215},
\seqnum{A000225},
\seqnum{A001220}, and
\seqnum{A077816}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received  February 9 2023;
revised versions received  March 16 2023; March 17 2023.
Published in {\it Journal of Integer Sequences}, March 17 2023.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}

                                                                                

</pre></body></html>