# The congruence speed formula

Marco Ripà

World Intelligence Network
Rome, Italy

e-mail: marco.ripa@mensa.it

**Abstract:** We solve a few open problems related to a peculiar property of the integer tetration $^b a$, which is the constancy of its congruence speed for any sufficiently large $b = b(a)$. Assuming radix-10 (the well-known decimal numeral system), we provide an explicit formula for the congruence speed $V(a) \in \mathbb{N}_0$ of any $a \in \mathbb{N} - \{0\}$ that is not a multiple of 10. In particular, for any given $n \in \mathbb{N}$, we prove to be true Ripà's conjecture on the smallest $a$ such that $V(a) = n$. Moreover, for any $a \neq 1 : a \neq 0 \pmod{10}$, we show the existence of infinitely many prime numbers $p_j := p_j(V(a))$ such that $V(p_j) = V(a)$.

**Keywords:** Tetration, Decadic number, Exponentiation, Integer sequence, Congruence speed, Modular arithmetic, Radix-10, Dirichlet's theorem, Arithmetic progression, Prime number.

**2020 Mathematics Subject Classification:** 11A07, 11N13.

## 1 Introduction

The aim of this paper is to give a general formula for the “congruence speed” of tetration [3, 13], affirmatively answering the final conjecture stated in [16]. The properties that arise from our study [20] are valid for many different numeral systems [2, 19], but (from here on out) we assume radix-10.

First of all, let us introduce the constancy of the congruence speed of the integer tetration $^b a$.

**Definition 1.1.** Let $a \in \mathbb{N} - \{0, 1\}$ not be a multiple of 10. Let $d \in \mathbb{N}$. The power tower of height

$$b \in \mathbb{N} - \{0\} \text{ represents the integer tetration } {}^b a := \begin{cases} a & \text{if } b = 1 \\ a^{(b-1)a} & \text{if } b \ge 2 \end{cases}.$$

Given $b^{b-1}a \equiv {}^b a \pmod{10^d} \land b^{b-1}a \not\equiv {}^b a \pmod{10^{d+1}}$, $\forall b > a \ge 2$, $V(a, b)$ returns the strictly positive integer such that $b^a \equiv b^{b+1}a \pmod{10^{d+V(a)}} \land b^a \not\equiv b^{b+1}a \pmod{10^{d+V(a)+1}}$, and we define $V(a, b)$ as the “congruence speed” of the base $a$ at the given height of its hyperexponent $b$. Consequently, if $a = 2$, the tetrations for $b$ from 1 to 5 are $1^2 = 2$, $2^2 = 4$, $3^2 = 16$, $4^2 = 65536$, and $5^2 = \dots 19156736$ (respectively), so we can see that $V(2, 1) = V(2, 2) = 0$, while $V(2, 3) = V(2, 4) = 1$.

Now, let us assume $a \in \mathbb{N} : a \neq 0 \pmod{10}$ in the rest of the paper.
Since it is known [16] that $b-1 \ge a \ge 2$ is a sufficient but not necessary condition for $V(a, b) = V(a)$, let $b : b > a \ge 2$ be (unless differently specified) such that we can simply indicate as $V(a)$ the “constant congruence speed” of $a$, where $V(a)$ has been already defined in Reference [16], Definition 2.1, assuming $V(1) = 0$ (see [16], pages 248–249). To this purpose, it is crucial to underline that the constancy of the congruence speed of $a$ is a general property concerning also cases where the minimum value of $b$ such that $V(a, b) = V(a)$ is smaller than $a$ itself (for a proof that $b \ge 2$ implies $V(3, b) = V(3)$, see [16], Lemma 4.3). Furthermore, for given pivotal tetrations, an in-depth analysis of the smallest $b$ such that the related congruence speed is constant can be found in Reference [15].

## 2 A formula for the constant congruence speed of a

In the present Section we study $V(a)$, taking into account every $a \ne 0 \pmod{10}$ [13]. In the first subsection, for any given $V(a) = n \in \mathbb{N} - \{0, 1\}$, we show which are the smallest bases whose residues modulo 10 cover the whole set $\{1, 2, 3, 4, 5, 6, 7, 8, 9\}$. The second subsection is devoted to provide a general formula which maps any $a$ whose constant congruence speed is given, for any $V(a) \in \mathbb{N}$.

### 2.1 Finding bases with arbitrarily large $V(a)$ in the ring of decadic integers

In order to describe the structure of $V(a) \in \mathbb{N} - \{0\}$ in radix-10, for any $a \ne 0 \pmod{10}$, it can be useful to move the problem on $\mathbb{Z}_{10}$, the ring of 10-adic integers.

**Proposition 2.1.** The 10-adic integers form a commutative ring, and we indicate it as $\mathbb{Z}_{10}$ [4].

**Proposition 2.2.** Any positive integer can be represented as a 10-adic integer $\alpha$. $\alpha$ can be written as an infinitely long string of digits going to the left of a “fixed digit”. The aforementioned fixed digit, that we indicate as $s_1$, is the one which defines the congruence class (AKA residue modulo 10) of the corresponding base of the tetration $^b a$. For any $n = 1, 2, 3, \dots$, let us consider $S(n) := s_n - s_{n-1} - \dots - s_2 - s_1 \in \frac{\mathbb{Z}}{10^n \mathbb{Z}}$, where the underscored symbol has been introduced in order to indicate the juxtaposition of nonnegative integers so that $S(n+1) = s_{(n+1)} - S(n)$. The residues modulo $10^n$ satisfy the congruence relation $S(n) \equiv S(n+1) \pmod{10^n}$. Now, assume $s_1 \in \{1, 2, 3, \dots, 9\}$ and, if $n \ge 2$, let $s_{j+1} \in \{0, 1, 2, \dots, 9\}$ for every $j \in \{1, \dots, n-1\}$. In particular, we have that $a_{s_1}(n) := \sum_{j=0}^{n-1} s_{j+1} \cdot 10^j \Rightarrow a_{s_1}(n) \equiv s_1 \pmod{10}$. Thus, given $n$, $a_{s_1}(n)$ is a strictly positive decimal integer, smaller than $10^{n+1}$, having $s_1$ as its least significant digit.

On the other hand, we know that, $\forall a_{s_1}(n), \exists \alpha \in \mathbb{Z}_{10}$ such that $\alpha = \sum_{j=0}^{+\infty} s_{j+1} \cdot 10^j \equiv \sum_{j=0}^{n-1} s_{j+1} \cdot 10^j \pmod{10^n} = a_{s_1}(n)$.

Consequently, the idea to work with decadic integers can be an efficient approach to solve (radix-10) the problem of finding, for each congruence class modulo 10 belonging to the set $\{1, 3, 7, 9\}$, which is the smallest tetration base whose constant congruence speed is equal to any given positive integer $n$.
**Definition 2.1.** For every $n \in \mathbb{N} - \{0\}$, we define $\tilde{a}(n) := \min_n\{a \neq 0 \pmod{10} : V(a) = n\}$. In addition, for any given $s_1 \in \{1, 2, 3, 4, 5, 6, 7, 8, 9\}$, let us denote with $a_{\{s_1\}}(n)$ the generic element of the set $A_{s_1}(n) := \{a : a \equiv s_1 \pmod{10} \wedge V(a) = n\}$. Consequently, $\forall n \ge 1$, $\tilde{a}_{s_1}(n) = \min_n (A_{s_1}(n))$ and $\tilde{a}_{\{1,2,3,4,5,6,7,8,9\}}(n) = \min_n \{\tilde{a}_1(n), \tilde{a}_2(n), \dots, \tilde{a}_9(n)\} = \tilde{a}(n)$.

In order to avoid notational misunderstandings, let us specify that, from here on, $a_{\{c,d\}} \in \{A_c \cup A_d\}$ refers to every (generic) tetration base that is congruent modulo 10 to $c$ or $d$ (assuming that $c$ and $d$ represent two distinct elements of the set $\{1, 2, 3, 4, 5, 6, 7, 8, 9\}$). We use the notation $a_{[c,d]}$ to indicate that we are considering one particular element from the congruence class $c$ modulo 10 and also another one from the congruence class $d$ modulo 10 so that $\tilde{a}_{[c,d]}$ (see Section 2.2) returns the smallest base which is congruent modulo 10 to $c$ and the smallest one which is congruent modulo 10 to $d$, while $\tilde{a}\{c, d\} = \min(\tilde{a}_c, \tilde{a}_d)$ gives the smallest base that is congruent modulo 10 to $c$ or $d$. In particular, let us simply write $a_{s_1}$ (omitting brackets) if, by selecting each one of the allowed congruence classes $s_1$, we always get a unique base, making it clear that the elements belonging to special subsets of $\{a \in \mathbb{N} : a \neq 0 \pmod{10}\}$ will be uniquely marked by adding symbols on the top of $a$ itself (such as the aforementioned $\tilde{a}_c$ or even $\hat{a}^*$), while different mathematical objects will be introduced by using other letters so that $y_c(5)$, which indicates the $c$-th solution in $\mathbb{Z}_{10}$ of the equation $y^5 = y$ (see Proposition 2.6), should not be confused with any base ending in $c$ (the decadic integer originated by $y_c(5)$ is in no way forced to have $c$ as its rightmost digit). To this purpose, we finally observe that $y^5 = y$ returns at most two decadic integers, say $\alpha'_c$ and $\alpha''_c$, both having the same $c$ as their rightmost digit; since each of the $\alpha'_{s_1}$ is well defined for any given $s_1 = 1, 2, \dots, 9$, we are free to introduce some general properties pertaining to the $\alpha'_{s_1}$ without needing to add unnecessary brackets.

**Proposition 2.3.** Let us consider the standard decimal numeral system (radix-10). It follows that the corresponding g-adic ring that we have to take into account is the decadic one ($g=10$) [5], but 10 is not a prime number or a power of a prime (since $10 = 2 \cdot 5 = p_1 \cdot p_2$, $p_1 \neq p_2$). Thus, for every odd $s_1$ (as defined in Proposition 2.2), we can find more than one polymorphic $\alpha = \dots - s_1$ that arises when we solve in $\mathbb{Z}_{10} := \lim_{\leftarrow 10^n\mathbb{Z}} \frac{\mathbb{Z}}{10^n}$ (i.e., the set of formal series $\sum_{j=0}^{+\infty} s_{j+1} \cdot 10^j$, $s_{j+1} \in \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}$) the fundamental equation $y^t = y$.

Therefore, assuming $s_{n+1} \neq 0$, $\forall s_1 \in \{1, 3, 5, 7, 9\}$, we can find two order-$n$ residues of as many polymorphic integers (i.e., $\alpha' \neq \alpha''$ such that $\alpha' \equiv \alpha'' \pmod{10}$) whose expansions modulo $10^n$ are always characterized by a constant congruence speed equal to $n$ (e.g., $s_1 = 7 \Rightarrow \alpha'_{s_1} = \dots 66295807$ and $\alpha''_{s_1} = \dots 92077057$ both satisfy $y^5 = y$, and $n=7$ implies that $V(\alpha' \pmod{10^7}) = V(66295807) = V(\alpha'' \pmod{10^7}) = V(92077057) = 7$ since the eighth rightmost digit of $\alpha'_7$ and $\alpha''_7$ is not zero).

**Conjecture 2.1.** Let the tetration base $a$ be greater than 1. Let $\text{len}(a) \in \mathbb{N} - \{0\} : 10^{\text{len}(a)-1} \le a < 10^{\text{len}(a)}$ denote the number of digits of $a$. If $a \neq \{0, 3, 7\} \pmod{10}$, then $b \ge \text{len}(a) + 2$ is a sufficient condition for $V(a, b) = V(a)$.

**Remark 2.1.** Assuming $a \equiv \{2, 3, 4, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23\} \pmod{25}$, by Reference [16], Hypothesis 1, $V(a) = 1$. This confirms the statement of Conjecture 2.1 for any
a as above, since we know that $V(a) \ge 1 \wedge V(a, b+1) \le V(a, b)$ holds for any $b \ge 3$ [15, 16];
as a clarifying example of the property $V(a, b+1) \le V(a, b)$ extended to nontrivial congruence
classes modulo 25, we can take a look at [15], page 27, which includes the phase shift analysis of
the base 143$^{625}$ congruent to 18 modulo 25, explaining why $V(143^{625}, 1) = 0 \wedge V(143^{625}, 2) =$
$V(143^{625}, 3) = 6 \wedge V(143^{625}, 4) = 5 \wedge V(143^{625}, b : b \ge 5) = V(a) = 4$ occurs.
Thus, $a : V(a) = 1$ implies that, for any $b \ge 3$, $1 = V(a, b) \ge V(a, b+1) \ge 1$ so that
$V(a, b+1) = V(a, b) = 1$ (e.g., $V(2, b : b \ge 3) = V(2, b : b \ge \text{len}(2)+2) = 1$ is consistent
with the expected result [3]).

**Proposition 2.4.** The constant congruence speed of a is well defined if and only if $a \neq 0 \pmod{10}$ [16]. In particular, $V(a) \ge 1 \Rightarrow a \ge 2$, and $b \ge a+1$ represents a sufficient, but not a necessary, condition for the constancy of the congruence speed of a. Moreover, $\exists a^* \equiv \{3,7\} \pmod{10}$ : $V(a^*, 2 \le b \le \text{len}(a^*) + 2) = 1 + V(a^*, b \ge \text{len}(a^*) + 3) = 1 + V(a^*)$, where $a^* \in \{807, 81666295807, 81907922943, \dots\}$, and this follows from Proposition 2.6 (check ($i \in \{3, 4, 9, 10\}, n > 2$) in Equation (2) such that, picking each of the four aforementioned values of $i$ so that $\alpha_{\{3,7\}}$ is given, $\frac{\alpha_{\{3,7\}} (\mod 10^{n+1}) - \alpha_{\{3,7\}} (\mod 10^n)}{10^n} = 5$).

**Proposition 2.5.** $g = 10 = 2 \cdot 5 = p_1 \cdot p_2 \Rightarrow \text{gcd}(p_1, p_2) = 1$ (see Proposition 2.3). Since in $\mathbb{Z}_{10}$ (which is not an integral domain) $\exists h \neq 0 \wedge r \neq 0$ such that $h \cdot r = 0$, it follows that, for every $n \in \mathbb{N}$, $5^{2n} \cdot 2^{5n} \equiv 0 \pmod{10^n}$ by the ring homomorphism $\phi : \mathbb{Z}_{10} \to \frac{\mathbb{Z}}{10^n\mathbb{Z}}$. Since the sequence $\{5^{2^n}\}_n := 5^{2^0}, 5^{2^1}, 5^{2^2}, \dots$ converges 5-adically to 0 and 2-adically to 1, and $\{2^{5n}\}_\infty = 1 - \{5^{2^n}\}_\infty$, the above is the unique pair which induces the decomposition of $\mathbb{Z}_{10}$. Thus, $\mathbb{Z}_{10} \cong \mathbb{Z}_5 \oplus \mathbb{Z}_2$ (where $\oplus$ indicates the direct sum) since, for $p$ prime, the complete ring $\mathbb{Z}_p$ contains only the two idempotents elements 0 and 1, and the 5-adically plus 2-adically convergence implies the 10-adically convergence (by Cauchy's convergence criterion). Hence, assume $h(n) \simeq 5^{2n}$ and $r(n) \simeq 2^{5n}$ in order to solve the fundamental equation $y^t = y$, introduced by Proposition 2.3.

Given $s_1 = 5$, if $h_n = 5^{2n} \pmod{10^n}$, then $\lim_{\infty \to n} h_n = \dots 92256259918212890625$ [4].

Similarly, for $s_1 = 2$, $r_n = 2^{5n} \pmod{10^n} \Rightarrow \lim_{\infty \to n} r_n = \dots 804103263499879186432$.

Now, let $\{y_i(t), i = 1, 2, \dots\}$ be the set of the $i$ solutions in $\mathbb{Z}_{10}$ of $y^t = y$, and also let $\{\hat{y}_i(t), \hat{i} = 1, 2, \dots\}$ be a subset of $\{y_i(t)\}$. If $t=2$, then $\nexists \hat{i} : y_i(t) \in \{0,1\} \Leftrightarrow y_i(2) \in \{h, 1-h\}$ for any $\hat{i}$, so let $y_1(2) = h$ and $y_2(2) = 1-h$.

Following the path above, it is possible to verify that all the solutions of $y^t = y$ belong to the set of the solutions of $y^5 = y$ [6]. Thus, for every given $\hat{i}$ such that $y_i(t) \notin \{0,1\}$, $y_i(5) \mapsto a(n) = s_{n-s_{(n-1)}-\dots-s_2-s_1} \Rightarrow V(a(n)) \ge n$. We point out that $s_{n+1} = 0 \Rightarrow V(a(n)) > n$ and $V(a(n)) = n \Rightarrow s_{n+1} \ne 0$, since $s_{n-\dots-s_2-s_1} \equiv s_{(n+1)-s_n\dots-s_2-s_1} \pmod{10^n} \wedge s_{n-\dots-s_2-s_1} \not\equiv s_{(n+1)-s_n\dots-s_2-s_1} \pmod{10^{n+1}}$ is a necessary condition for $V(a(n)) = n$. In particular, we should note that if $y_{(1,3,4,9,10,12,13,15)}$ (5) originates all the pentamorphic integers coprime to 10 satisfying $y^t = y$ (see Proposition 2.6, Equation (2)), then $y_{(1,3,4,9,10,12)}(5) \mapsto (\pm(1-2\cdot5^{2n}) \pmod{10^n}, \pm(5^{2n}-2^{5n}) \pmod{10^n}, \pm(5^{2n}+2^{5n}) \pmod{10^n})$ is enough to find all the smallest bases $\bar{a}_{[1,3,7,9]}(n) \le \tilde{a}_{[1,3,7,9]}(n)$ characterized by a constant congruence speed which is at least equal to any given strictly positive integer $n$. Hence, considering each of the four mentioned congruence classes modulo 10, the $\bar{a}_{[1,3,7,9]}(n)$ (whose constant congruence speed is $V(\bar{a}_{[1,3,7,9]}(n)) \ge n$) are given by Equation (1),
$$
\bar{a}_{[1,3,7,9]}(n) = \begin{cases}
(1 - 2 \cdot 5^{2^n}) (\text{mod } 10^n) & \text{iff } a \equiv 1 (\text{mod } 10) \land a \neq 1 \\
\min_n ((5^{2^n} - 2^{5^n}) (\text{mod } 10^n), -(5^{2^n} + 2^{5^n}) (\text{mod } 10^n)) & \text{iff } a \equiv 3 (\text{mod } 10) \\
\min_n ((5^{2^n} + 2^{5^n}) (\text{mod } 10^n), (2^{5^n} - 5^{2^n}) (\text{mod } 10^n)) & \text{iff } a \equiv 7 (\text{mod } 10) \\
(2 \cdot 5^{2^n} - 1) (\text{mod } 10^n) & \text{iff } a \equiv 9 (\text{mod } 10)
\end{cases} \tag{1}
$$

In Equation (1), the condition $a \neq 1$ follows from the definition of $V(a)$ itself, which includes $V(1) = 0 < n$ (for the reasons explained in Reference [16], pages 248–249). Since $b=1$ is congruent modulo $10^m$ to $b+1$ for any $m \in \mathbb{N}_0$, the constant congruence speed of $a=1$ is special, and this explains why, in the next proposition, we will exclude $y_{15}(t) : 1^t = 1$ from the set of the nontrivial solutions of $y^t = y$.

**Proposition 2.6.** Let $h(n) \simeq 5^{2^n}$ and $r(n) \simeq 2^{5^n}$, as usual. Assume $t \ge 5$ and let $\{y_i(t), i \in \mathbb{Z}^+\}$ represent the set of all the solutions in $\mathbb{Z}_{10}$ of the fundamental equation $y^t = y$ (i.e., $i \in \{1, 2, 3, \dots, 14, 15\}$). Assume that $\alpha'_{s_1} \in \mathbb{Z}_{10}$ and $\alpha''_{s_1} \in \mathbb{Z}_{10}$ (if any) are not equal each other for any $s_1 \in \{1, 2, \dots, 9\}$ so that we denote with $\{\alpha'_{s_1} \cup \alpha''_{s_1}\} := \{y_{\hat{i}}(t), \hat{i} = 1, 2, \dots\}$ the subset formed by the $y_i(t)$ which are not congruent modulo $10^2$ to $\{0, 1\}$. It follows that $\{y_i(5), i = 1, \dots, 15\} \supsetneq \{\alpha'_1, \alpha'_2, \alpha'_3, \alpha''_3, \alpha'_4, \alpha'_5, \alpha''_5, \alpha'_6, \alpha'_7, \alpha''_7, \alpha'_8, \alpha'_9, \alpha''_9\}$, since $y_{14}(t) : 0^t = 0$ and $y_{15}(t) : 1^t = 1$ show the existence of two (trivial) solutions of $y^5 = y$ which are not included in the previously mentioned subset. In order to understand how the remaining $y_i(t)$ anticipate the recurrence rules stated in Section 2.2, it can be helpful to preliminary observe that the $y_i(t)$ follow from $\lim_{n \to \infty} 5^{2^n} = \frac{1+\sqrt{1}}{2} \Rightarrow y = \lim_{n \to \infty} 5^{2^n} = \lim_{n \to \infty} 5^{2^{n+1}} = y^2 \Rightarrow y_{j \le i}(2) = y_{(6,8,14,15)}(t) = \{\alpha'_5, \alpha'_6, 0, 1\}$, and then we can also verify that $\alpha'_9 = -\alpha'_1 = \sqrt{1} = \lim_{n \to \infty} \frac{5^n - 2^n}{5^n + 2^n} [7, 8]$. Considering $t=5$, we find in a similar way all the other roots (e.g., see References [9–12] for $\alpha'_3, \alpha''_3, \alpha'_7$, and $\alpha''_7$), so it is possible to conclude that the $y_{i \le 13}(t \ge 5)$ are such that $\alpha'_1 = -\alpha'_9, \alpha'_2 = -\alpha'_8, \alpha'_3 = -\alpha'_7, \alpha''_3 = -\alpha''_7, \alpha'_4 = -\alpha'_6, \alpha'_5 = -\alpha''_5$, and $\alpha''_9 = -1$. Furthermore, for any $n$, $r(n)^2 + 1 = h(n) \mapsto 5^{2^n} \equiv (2^{5^n})^2 + 1 \pmod{10^n}$ if and only if $5^{2^n} \equiv (4^{5^n} + 1) \pmod{10^n}$. In general, as clearly explained by Michon in Reference [6], we have
$7532318 = \tilde{a}_8(9) > \tilde{a}_8(10) = \alpha'_8(9) (\text{mod } 2 \cdot 5^9)).$

In particular, if $\hat{s}_1 \in \{4, 6\}$, then $\tilde{a}_4(n) = 5^n - 1 \wedge \tilde{a}_6(n) = 5^n + 1$ follows by construction (see $y_{(5,8)}(5)$ by Equation (2)). Trivially, for any $n$, $5^n - 1 \equiv (5^n - 1) (\text{mod } 2 \cdot 5^n)$ and also $5^n + 1 \equiv (5^n + 1) (\text{mod } 2 \cdot 5^n)$; thus, $\hat{s} = (4 \vee 6) \Rightarrow \lambda_{(4,6)} = 0$ for any positive integer $n$.

Finally, we have that $\lambda_{\hat{s}_1}(n) = 1$ if and only if $\hat{s}_1 = (2 \vee 8) \wedge \alpha'_{\hat{s}_1}(n) (\text{mod } 2 \cdot 5^n) = \alpha'_{\hat{s}_1}(n+1) (\text{mod } 2 \cdot 5^{n+1})$, while $\lambda = 0$ otherwise.

This concludes the proof that, for any $n \ge 1$ and each $\hat{s}_1 \in \{2, 4, 6, 8\}$, $\exists k(\hat{s}_1, n) \in \mathbb{N}_0 : \alpha'_{\hat{s}_1}(n) - k \cdot 2 \cdot 5^n = \tilde{a}_{\hat{s}_1}(n)$.

Lastly, we can find bases congruent to 5 modulo 10 that are smaller than $\min_n (\alpha'_5(n), \alpha''_5(n))$ and whose constant congruence speed is at least equal to $n$, by simply taking into account that $P'(\alpha'_5(n)) = P'(\alpha''_5(n)) = 5 \cdot 2^{n+1}$ (see [16], Section 5) and introducing the additional condition $n > 2$.

Thus,

$$V(\alpha'_5(n) (\text{mod } 10 \cdot 2^n)) \ge n \wedge V(\alpha''_5(n) (\text{mod } 10 \cdot 2^n)) \ge n, \quad (3)$$

and Equation (3) let us confirm the validity of Equation (5) (e.g., if $n = 20$, then $\alpha'_5(20) = 92256259918212890625$ is congruent modulo $10 \cdot 2^{20}$ to 9437185 and $V(9437185) = 20$, while $V(\alpha''_5(20) (\text{mod } 10 \cdot 2^{20})) = V(6291455) = 21 > n$).

## 2.2 Main result

We show that Equation (4) is true for any $n \ge 2$ (i.e., $n \ge 2 \Rightarrow \tilde{a}_5(n) = \tilde{a}(n)$, see Definition 2.1).

$$\tilde{a}(n) = \min_n \left( 2^n \cdot \left( 2 \cdot \cos \left( \frac{\pi \cdot (n-1)}{2} \right) - 4 \cdot \sin \left( \frac{\pi \cdot (n-1)}{2} \right) + 5 \right) + 1, \right. \\ \left. 2^n \cdot \left( 4 \cdot \sin \left( \frac{\pi \cdot (n-1)}{2} \right) - 2 \cdot \cos \left( \frac{\pi \cdot (n-1)}{2} \right) + 5 \right) - 1 \right). \quad (4)$$

Hence,

$$\tilde{a}(n) = \begin{cases} 2^n \cdot \left(5 + 2 \cdot \sin\left(\frac{\pi \cdot n}{2}\right) + 4 \cdot \cos\left(\frac{\pi \cdot n}{2}\right)\right) + 1 & \text{iff } n \equiv \{2, 3\} (\text{mod } 4) \\ 2^n \cdot \left(5 - 2 \cdot \sin\left(\frac{\pi \cdot n}{2}\right) - 4 \cdot \cos\left(\frac{\pi \cdot n}{2}\right)\right) - 1 & \text{iff } n \equiv \{0, 1\} (\text{mod } 4) \end{cases}. \quad (5)$$

Now, assume $b > a \ge 2$ (as usual), even if for any $a \equiv \{1, 2, 4, 5, 6, 8, 9\} (\text{mod } 10)$ we are persuaded that $b \ge \text{len}(a) + 2$ represents a sufficient condition for $V(a, b) = V(a)$, as predicted by Conjecture 2.1 [2, 19]. Then, for any given $n \in \mathbb{N} - \{0, 1\}$, $V(a_{\{s_1\}}(n)) = n$, $\forall s_1 \in \{1, 2, 3, 4, 5, 6, 7, 8, 9\}$, if and only if Equations (6), (7), (8), (10), (11), (14), (15), (16), and (17) are satisfied.

$$A_1(n) = \begin{cases} (2^{4.5^{n+1}} - 1) (\text{mod } 10^n) + j_n \cdot 10^n, & \forall j_n \ne \frac{(2^{4.5^{n+1}} - 1) (\text{mod } 10^{n+1}) - (2^{4.5^{n}} - 1) (\text{mod } 10^n)}{10^n} (\text{mod } 10) \\ 10^n + 1 + k \cdot 10^n, & \forall k \equiv \{0, 1, 2, 3, 4, 5, 6, 7, 8\} (\text{mod } 10) \end{cases}. \quad (6)$$
With reference to Equation (6), we observe that the previously stated condition $n \in \mathbb{N} - \{0, 1\}$ assures $n \neq 1$ so that we have excluded a priori the possibility that $(2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^1) + 0 \cdot 10^n = 1 > 0$ gives a contradiction, inasmuch as $V(1) = 0$ by definition.

Since $(k+1) \cdot 10^n + 1 > (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^n)$ is always true, Equation (6) implies that if $n : (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^n) \neq (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^{n+1})$, then $\exists! a_1(n) \le (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^n)$. Thus, if the $(n+1)$-th rightmost digit of $\alpha'_1$ (see Equation (2)) is nonzero, then the unique base $a_1(n) \le (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^n)$ corresponds to the desired $\tilde{a}_1(n)$.

In general (as introduced in Proposition 2.6), $V(a_{\{1,9\}}) \le \min(\acute{n}, \acute{n})$, where $\acute{n} : 5^{\acute{n}} | (a_{\{1,9\}}^2 - 1) \wedge 5^{\acute{n}+1} \nmid (a_{\{1,9\}}^2 - 1)$, and $\acute{n} : 2^{\acute{n}} | (a_{\{1,9\}}^2 - 1) \wedge 2^{\acute{n}+1} \nmid (a_{\{1,9\}}^2 - 1)$ (i.e., $\acute{n} \neq 0$ is equal to the 5-adic valuation of $(a_{\{1,9\}}^2 - 1)$, while $\acute{n} \neq 0$ indicates the 2-adic valuation of $(a_{\{1,9\}}^2 - 1)$).

It follows that, $\forall n \ge 2, 10^n + 1 \ge \tilde{a}_1(n) > \sqrt{5^n + 1}$ (since $5^n + 1$ is even).

Similarly to Equation (6), if $s_1 = 9$, we have

$$A_9(n) = \begin{cases} (2 \cdot 5^{2n} - 1) (\text{mod } 10^n) + j_n \cdot 10^n, & \forall j_n \neq \frac{(2 \cdot 5^{2n+1} - 1) (\text{mod } 10^{n+1}) - (2 \cdot 5^{2n} - 1) (\text{mod } 10^n)}{10^n} (\text{mod } 10) \\ 10^n - 1 + k \cdot 10^n, & \forall k \equiv \{0, 1, 2, 3, 4, 5, 6, 7, 8\} (\text{mod } 10) \end{cases}. \quad (7)$$

As previously shown, if $n : (2 \cdot 5^{2n} - 1) (\text{mod } 10^n) \neq (2 \cdot 5^{2n+1} - 1) (\text{mod } 10^{n+1})$, then $\exists! a_9(n) \le (2 \cdot 5^{2n} - 1) (\text{mod } 10^n)$. In general, $V(a_{\{1,9\}}) \le \min(\acute{n}, \acute{n})$ and Equation (7) imply that $10^n > \tilde{a}_9(n) > \sqrt{5^n + 1}$.

We point out that, as a consequence of Proposition 2.6 (see the case $s_{n+1} = 0$),

$$n : \frac{(2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^{n+1}) - (2^{4 \cdot 5^{n}} - 1) (\text{mod } 10^n)}{10^n} \equiv 0 (\text{mod } 10) \\ \Rightarrow (2^{4 \cdot 5^{n+1}} - 1) \equiv (2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^{n+1}) \Rightarrow V((2^{4 \cdot 5^{n+1}} - 1) (\text{mod } 10^n)) > n, \\ \text{and similarly}$$

$$n : (2 \cdot 5^{2n+1} - 1) (\text{mod } 10^{n+1}) - (2 \cdot 5^{2n} - 1) (\text{mod } 10^n) \equiv 0 (\text{mod } 10^{n+1}) \\ \Rightarrow (2 \cdot 5^{2n} - 1) \equiv (2 \cdot 5^{2n+1} - 1) (\text{mod } 10^{n+1}) \Rightarrow V((2 \cdot 5^{2n} - 1) (\text{mod } 10^n)) > n \\ \text{(e.g., } V(163574218751) = V((2^{4 \cdot 5^{12}} - 1) (\text{mod } 10^{12})) = 13).$$

Let us consider the case $s_1 = 5$. From [16], we know that, $\forall n \in \mathbb{N} - \{0, 1\}$,

$$A_5(n) = \begin{cases} 2^n \cdot (5 + 2 \cdot \sin(\frac{\pi \cdot n}{2}) + 4 \cdot \cos(\frac{\pi \cdot n}{2})) + 1 + k \cdot 5 \cdot 2^{n+1}, & \forall k \in \mathbb{N}_0 \\ 2^n \cdot (5 - 2 \cdot \sin(\frac{\pi \cdot n}{2}) - 4 \cdot \cos(\frac{\pi \cdot n}{2})) - 1 + k \cdot 5 \cdot 2^{n+1}, & \forall k \in \mathbb{N}_0 \end{cases}. \quad (8)$$
Equation (8) implies that

$$ \tilde{a}_5(n) \leq 9 \cdot 2^n + 1, \qquad (9) $$

and the last inequality (trivially) holds because, $\forall n \in \mathbb{N}$,

$$ \max \left( \pm x \cdot \cos \left( \frac{\pi}{2} \cdot n \right) \pm y \cdot \sin \left( \frac{\pi}{2} \cdot n \right) \right) = \max (|x|, |y|). $$

If $s_1 = 4$ or $s_1 = 6$, for the reasons already discussed in the previous subsection, we have, respectively,

$$ A_4(n) = 5^n - 1 + k \cdot 2 \cdot 5^n, \forall k \equiv \{0, 1, 3, 4\} \pmod 5; \qquad (10) $$

$$ A_6(n) = 5^n + 1 + k \cdot 2 \cdot 5^n, \forall k \equiv \{0, 1, 3, 4\} \pmod 5. \qquad (11) $$

Equations (10) and (11) imply that, $\forall n, a_{\{4\}}(n) = a_{\{6\}}(n) - 2$.

Thus, $\min_n (\tilde{a}_4(n), \tilde{a}_6(n)) = \tilde{a}_4(n) = 5^n - 1$.

Now, we study the cases $s_1 = 2$ and $s_1 = 8$. In general, $V(a_{\{2,8\}})$ is less than or equal to $\hat{n}$, the 5-adic valuation of $(a_{\{2,8\}}^2 + 1)$, and in particular we have

$$ a_{\{2,8\}}(\hat{n}) = \sqrt{5^{\hat{n}} \cdot c_{a_{\{2,8\}}}(\hat{n}) - 1} = \sqrt{5^{\hat{n}-n} \cdot 5^n \cdot c_{a_{\{2,8\}}}(\hat{n}) - 1} \Rightarrow V(a_{\{2,8\}}(n)) = n \le \hat{n}. \quad (12) $$

Since $c_{a_{\{2,8\}}}(\hat{n})$ for any $\hat{n}$, Equation (12) states that $\min_n (\tilde{a}_2(n), \tilde{a}_8(n)) \ge \sqrt{5^n - 1}$.

More specifically, picking any value of $\hat{n}$, the constraint that $c_{a_{\{2,8\}}} = \frac{a_{\{2,8\}}^2 + 1}{5^n}$ have to be solved for $c_{a_{\{2,8\}}}$ over the integers (as a) let us calculate the solutions (taking the natural logarithm) from

$$ \hat{n} = \frac{\ln \left( \frac{a_{\{2,8\}}^2 + 1}{c_{a_{\{2,8\}}}} \right)}{\ln(5)}; \qquad (13) $$

as a random example, we can see that $\hat{n} = 20 \Rightarrow \frac{a_{\{2,8\}}^2 + 1}{5^{20}} = c \in \mathbb{N} \Rightarrow a_{\{2,8\}}(20) = (5^{20} \cdot 2 \cdot m + 15613890344818) \vee (5^{20} \cdot (2 \cdot m + 1) + 79753541295807)$, where $m \in \mathbb{N}_0$. Hence, $m = 0 \Rightarrow \tilde{a}_8(20) = 15613890344818$, $\tilde{a}_2(20) = 5^{20} \cdot 1 + 79753541295807 = 175120972936432$, (since $5^{20} \cdot d + 79753541295807$ is odd for any even value of $d$, including zero, while $5^{20} \cdot d + 15613890344818$ is odd if and only if $d$ assumes an odd value, and vice versa), and this is enough to conclude that $\tilde{a}_{[2,8]}(20) = \{175120972936432, 15613890344818\} \Rightarrow V(\tilde{a}_{[2,8]}(20)) = 20 \Rightarrow V(5^{20} \cdot (2 \cdot m + 1) + 79753541295807) \ge 20$ and so is $V(5^{20} \cdot 2 \cdot m + 15613890344818)$ (the last inequality can be proved by observing that $(\hat{n} = 20, s_1 = 2, m = 1) \Rightarrow a_2(\hat{n} = 20, m = 1) = (5^{20} \cdot (2 \cdot 1 + 1) + 79753541295807) = 365855836217682 = \tilde{a}_2(21) \Rightarrow V(a_2(20, 1)) = V(a_2(21, 0)) = V(476837158203125 \cdot 0 + 365855836217682) = V(\tilde{a}_2(21)) = 21 > 20 = V(\tilde{a}_2(20));$ ditto for $s_1 = 8$).

Equation (13) provides also a valid upper bound for the constant congruence speed of every element of $\{A_3 \cup A_7\}$, since $a_{\{2,3,7,8\}}^2 + 1 = \prod_{p_j \ne 5} p_j^{q_j} \cdot 5^{\hat{n}} \ge \prod_{p_j \ne 5} p_j^{q_j} \cdot 5^{V(a_{\{2,3,7,8\}})}$ (where $p_j$ represents any prime divisor of $a_{\{2,3,7,8\}}^2 + 1$ which is not equal to 5, while $q$ indicates how many times the corresponding $p$ appears in the factorization of $a_{\{2,3,7,8\}}^2 + 1$ [19]).
Furthermore, $V(a_{\{3,7\}}) \le \min(\hat{n}, \hat{n})$, where $\hat{n} : 5^{\hat{n}} | (a_{\{3,7\}}^2 + 1) \wedge 5^{\hat{n}+1} \nmid (a_{\{3,7\}}^2 + 1)$ and $\hat{n} : 2^{\hat{n}} | (a_{\{3,7\}}^2 - 1) \wedge 2^{\hat{n}+1} \nmid (a_{\{3,7\}}^2 - 1)$. It follows that, for any (strictly) positive integer $n$, $\min_n(\tilde{a}_3(n), \tilde{a}_7(n)) > \sqrt{5^n-1}$ (since $5^n-1$ is even).

As shown in Section 2.1, we can easily improve the above upper bound by taking advantage of the commutative ring of 10-adic integers, giving an explicit formula for $V(a_{\{3,7\}}) = n$ in the same way as we have already done for $V(a_{\{1,9\}})$. For this purpose, let $V(a_{\{3,7\}}) = n \le \hat{n}$.

Since $\alpha'_7 = h - r = -\alpha'_3$ and $\alpha''_7 = h + r = -\alpha''_3$ (where $h(n) \simeq 5^{2n}$ and $r(n) \simeq 2^{5n}$), if $s_1 = 3$, then

$$A_3(n) = \begin{cases} (5^{2n} - 2^{5n}) (\mod 10^n) + j_n \cdot 10^n, \\ \forall j_n \not\equiv \frac{(5^{2n+1}-2^{5n+1}) (\mod 10^{n+1})-(5^{2n}-2^{5n}) (\mod 10^n)}{10^n} (\mod 10) \\ (-5^{2n} - 2^{5n}) (\mod 10^n) + j_n \cdot 10^n, \\ \forall j_n \not\equiv \frac{(-5^{2n+1}-2^{5n+1}) (\mod 10^{n+1})-(-5^{2n}-2^{5n}) (\mod 10^n)}{10^n} (\mod 10) \end{cases}, \quad (14)$$

while the case $s_1 = 7$ is covered by Equation (15)

$$A_7(n) = \begin{cases} (2^{5n} - 5^{2n}) (\mod 10^n) + j_n \cdot 10^n, \\ \forall j_n \not\equiv \frac{(2^{5n+1}-5^{2n+1}) (\mod 10^{n+1})-(2^{5n}-5^{2n}) (\mod 10^n)}{10^n} (\mod 10) \\ (5^{2n} + 2^{5n}) (\mod 10^n) + j_n \cdot 10^n, \\ \forall j_n \not\equiv \frac{(5^{2n+1}+2^{5n+1}) (\mod 10^{n+1})-(5^{2n}+2^{5n}) (\mod 10^n)}{10^n} (\mod 10) \end{cases}. \quad (15)$$

In order to complete the (constant) congruence speed map, we only need a formula for $A_2(n)$ and $A_8(n)$, as shown by Equations (6), (7), (8), (10), (11), (14), and (15).

From Proposition 2.7, we know that $\alpha'_{(2,8)}(n) := \alpha'_{(2,8)}(\mod 10^n)$ implies $\alpha'_2(n) + \alpha'_8(n) = 10^n$, $\alpha'_2(n) (\mod 2 \cdot 5^n) + \alpha'_8(n) (\mod 2 \cdot 5^n) = 2 \cdot 5^n$, and $\tilde{a}_{(2,8)}(n) = \alpha'_{(2,8)}(n) (\mod 2 \cdot 5^n) + \lambda_{(2,8)}(n) \cdot 2 \cdot 5^n$, where

$$\lambda_{(2,8)}(n) = \begin{cases} 0 & \text{iff } \alpha'_{(2,8)}(n) (\mod 2 \cdot 5^n) \neq \alpha'_{(2,8)}(n+1) (\mod 2 \cdot 5^{n+1}) \\ 1 & \text{iff } \alpha'_{(2,8)}(n) (\mod 2 \cdot 5^n) = \alpha'_{(2,8)}(n+1) (\mod 2 \cdot 5^{n+1}) \end{cases}.$$

$$A_2(n) = \tilde{a}_2(n) + k \cdot 2 \cdot 5^n, \forall k \not\equiv \frac{\tilde{a}_2(n+1) - \tilde{a}_2(n)}{2 \cdot 5^n} (\mod 5), \quad (16)$$

$$A_8(n) = \tilde{a}_8(n) + k \cdot 2 \cdot 5^n, \forall k \not\equiv \frac{\tilde{a}_8(n+1) - \tilde{a}_8(n)}{2 \cdot 5^n} (\mod 5), \quad (17)$$

where, as usual, $\tilde{a}_2(n) = (2^{5n} (\mod 10^n)) (\mod 2 \cdot 5^n) + \lambda_2(n) \cdot 2 \cdot 5^n$ and $\tilde{a}_8(n) = (-2^{5n} (\mod 10^n)) (\mod 2 \cdot 5^n) + \lambda_8(n) \cdot 2 \cdot 5^n$.

Hence, $\tilde{a}_2(n) + \tilde{a}_8(n) = \alpha'_2(n) (\mod 2 \cdot 5^n) + \alpha'_8(n) (\mod 2 \cdot 5^n) + 2 \cdot 5^n \cdot (\lambda_2(n) + \lambda_8(n))$.
Since $\alpha'_2(n) (\text{mod } 2 \cdot 5^n) + \alpha'_8(n) (\text{mod } 2 \cdot 5^n) = 2 \cdot 5^n$, for any $n$, we have shown that
$\tilde{a}_2(n) = 2 \cdot 5^n \cdot (1 + \lambda_2(n) + \lambda_8(n)) - \tilde{a}_8(n)$, where $(\lambda_2(n) + \lambda_8(n)) \in \{0, 1, 2\}$.

In conclusion, if $V(a) = 1$, then

$$
a(1) \equiv \{2, 3, 4, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23\} \pmod{25}. \quad (18)
$$

Therefore, we have mapped all the bases $a$ such that $V(a) = n$.

The constant congruence speed formula that we have shown in the present section confirms
also Hypothesis 1 and Hypothesis 2, stated in Reference [16], as $V(a) \ge 2 \Rightarrow \mathcal{P}(V(a)) =
10^{V(a)+1}$ (see [15], Equation (10)).

Now, we are finally ready to prove that $n \ge 2 \Rightarrow \tilde{a}(n) = \tilde{a}_5(n) = 2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)}$, and this will be the goal of Section 3.

3 Smallest a for any given value of the constant congruence speed

In this section, we prove the last conjecture stated in [16].

**Theorem 3.1.** Let $\tilde{a}(n)$ be defined as in Definition 2.1. $\forall n \in \mathbb{N} - \{0, 1\}$,

$$
\tilde{a}(n) = \begin{cases} 2^n \cdot \left(5 + 2 \cdot \sin\left(\frac{\pi \cdot n}{2}\right) + 4 \cdot \cos\left(\frac{\pi \cdot n}{2}\right)\right) + 1 & \text{iff } n \equiv \{2, 3\} \pmod 4 \\ 2^n \cdot \left(5 - 2 \cdot \sin\left(\frac{\pi \cdot n}{2}\right) - 4 \cdot \cos\left(\frac{\pi \cdot n}{2}\right)\right) - 1 & \text{iff } n \equiv \{0, 1\} \pmod 4 \end{cases} ;
$$

$$
\text{while } \tilde{a}(1) = 2. \text{ Additionally, } \{a(0)\} = \{1\} = \tilde{a}(0).
$$

*Proof.* From Section 2.2 (see Equations (6) to (17)), we know that, $\forall n \ge 2$,

$$
\tilde{a}_{\{1,9\}}(n) = \min_n (\tilde{a}_1(n), \tilde{a}_9(n)) > \sqrt{5^n + 1};
$$

$$
\tilde{a}_{\{2,8\}}(n) = \min_n (\tilde{a}_2(n), \tilde{a}_8(n)) \geq \sqrt{5^n - 1};
$$

$$
\tilde{a}_{\{3,7\}}(n) = \min_n (\tilde{a}_3(n), \tilde{a}_7(n)) > \sqrt{5^n - 1};
$$

$$
\tilde{a}_{\{4,6\}}(n) = \min_n (\tilde{a}_4(n), \tilde{a}_6(n)) = \tilde{a}_4(n) = 5^n - 1.
$$

Hence,

$$
\begin{align}
\tilde{a}_{\{1,2,3,4,6,7,8,9\}}(n) &= \min_n (\tilde{a}_{\{1,9\}}(n), \tilde{a}_{\{2,8\}}(n), \tilde{a}_{\{3,7\}}(n), \tilde{a}_{\{4,6\}}(n)) \nonumber \\
&\Rightarrow \tilde{a}_{\{1,2,3,4,6,7,8,9\}}(n) \ge \sqrt{5^n - 1}. \tag{19}
\end{align}
$$

On the other hand, Equation (9) implies that $\mathbb{N} \ni n \in \mathbb{N} - \{0, 1\} : \tilde{a}_5(n) > 9 \cdot 2^n + 1$, since
$$
\tilde{a}_5(n) = \begin{cases} 2^n \cdot \left( 2 \cdot \cos\left(\frac{\pi \cdot (n-1)}{2}\right) - 4 \cdot \sin\left(\frac{\pi \cdot (n-1)}{2}\right) + 5 \right) + 1 & \text{iff } n \equiv \{2, 3\} \pmod 4 \\ 2^n \cdot \left( 4 \cdot \sin\left(\frac{\pi \cdot (n-1)}{2}\right) - 2 \cdot \cos\left(\frac{\pi \cdot (n-1)}{2}\right) + 5 \right) - 1 & \text{iff } n \equiv \{0, 1\} \pmod 4 \end{cases}
$$

Thus, in order to prove the main statement of Theorem 3.1, it is sufficient to check the inequality $\sqrt{5^n - 1} > 9 \cdot 2^n + 1$, observing that it is certainly true for every $n \ge 20$ (since $\sqrt{5^x - 1} = 9 \cdot 2^x + 1 \Rightarrow 19.693374 < x < 19.693375$). Consequently, we only need to verify that, $\forall n \in [2, 19]$, $\tilde{a}_5(n) < \tilde{a}_{\{1,2,3,4,6,7,8,9\}}(n)$, and the values are listed in Table 1 (see Equations (6) to (17)).

<table><caption>Table 1: Comparison between the smallest $a(n)$ congruent modulo 10 to 5, whose constant congruence speed is equal to $n \le 19$, and the minimum $a(n) \equiv \{1, 2, 3, 4, 6, 7, 8, 9\} \pmod{10}$.</caption><thead><tr><th>n = V(a)</th><th>tilde_a(n)</th><th>tilde_a{1,2,3,4,6,7,8,9}(n)</th></tr></thead><tbody><tr><td>1</td><td>2</td><td>2</td></tr><tr><td>2</td><td>5</td><td>7</td></tr><tr><td>3</td><td>25</td><td>57</td></tr><tr><td>4</td><td>15</td><td>182</td></tr><tr><td>5</td><td>95</td><td>3124</td></tr><tr><td>6</td><td>65</td><td>1068</td></tr><tr><td>7</td><td>385</td><td>32318</td></tr><tr><td>8</td><td>255</td><td>390624</td></tr><tr><td>9</td><td>1535</td><td>280182</td></tr><tr><td>10</td><td>1025</td><td>3626068</td></tr><tr><td>11</td><td>6145</td><td>23157318</td></tr><tr><td>12</td><td>4095</td><td>120813568</td></tr><tr><td>13</td><td>24575</td><td>1220703124</td></tr><tr><td>14</td><td>16385</td><td>1097376068</td></tr><tr><td>15</td><td>98305</td><td>11109655182</td></tr><tr><td>16</td><td>65535</td><td>49925501068</td></tr><tr><td>17</td><td>393215</td><td>762939453124</td></tr><tr><td>18</td><td>262145</td><td>355101282318</td></tr><tr><td>19</td><td>1572865</td><td>19073486328124</td></tr></tbody></table>

As it follows from Equations (9) and (19), $\forall n \in \mathbb{N} - \{0, 1\}$, $\tilde{a}(n) := \tilde{a}_{\{1,2,3,4,5,6,7,8,9\}}(n) = \tilde{a}_5(n)$.

Therefore, in order to complete the proof, it is sufficient to observe that $V(2) = 1$ and $V(1) = 0$ (see [16]). $\square$

**Corollary 3.2.** Let $\tilde{a}(n)$ be defined as in Definition 2.1, and let $i^2 = -1$. $\forall n \in \mathbb{N} - \{0, 1\}$,

$$
\tilde{a}(n) = 2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)}. \qquad (20)
$$
**Proof.** The statement of Corollary 3.2 easily follows from Theorem 3.1.

Since, in September 2020, Bruno Berselli noted that Sequence A337392 of the OEIS is given by $a(n) = (2 - (-1)^n) \cdot 2^n + i^{(n+1)\cdot(n+2)}$ (see Formula in Reference [14]), it trivially follows that Equation (5) can be further simplified if we prove the claim;

$$ 
\begin{aligned}
\tilde{a}(n) &= \begin{cases} 2^n \cdot (5 + 2 \cdot \sin(\frac{\pi \cdot n}{2}) + 4 \cdot \cos(\frac{\pi \cdot n}{2})) + 1 & \text{iff } n \equiv \{2, 3\} \pmod 4 \\ 2^n \cdot (5 - 2 \cdot \sin(\frac{\pi \cdot n}{2}) - 4 \cdot \cos(\frac{\pi \cdot n}{2})) - 1 & \text{iff } n \equiv \{0, 1\} \pmod 4 \end{cases} \\
&= 2^{n+1} + \left( \sin\left(\frac{\pi \cdot (n+1) \cdot (n+2)}{2}\right) - 2^n \cdot \sin(\pi \cdot n) \right) \cdot i - 2^n \cdot \cos(\pi \cdot n) \\
&\qquad + \cos\left(\frac{\pi \cdot (n+1) \cdot (n+2)}{2}\right).
\end{aligned}
\quad (21) $$

Hence, $2^n \cdot \cos(\pi \cdot n) - i \cdot 2^n \cdot \sin(\pi \cdot n) = -2^n \cdot e^{i \cdot \pi \cdot n}$ implies that

$$ \tilde{a}(n) = 2^{n+1} - 2^n \cdot e^{i \cdot \pi \cdot n} + e^{\frac{i \cdot \pi}{2} \cdot (n \cdot (n+3)+2)}. \quad (22) $$

Since $e^{i \cdot \pi} + 1 = 0 \Rightarrow e^{\frac{i \cdot \pi}{2}} = i$ and $e^{i \cdot \pi \cdot n} = (-1)^n$, it follows that

$$ \tilde{a}(n) = 2^{n+1} - 2^n \cdot (-1)^n + i^{n \cdot (n+3)+2}. \quad (23) $$

Thus, Berselli's formula is correct and we have

$$ \tilde{a}(n) = 2^{n+1} + 2^n \cdot (-1)^{n-1} - i^{n \cdot (n+3)}. \quad (24) $$

Therefore, in order to confirm Equation (20) and conclude the proof, it is sufficient to observe that $i^{n \cdot (n+3)} = i^{n \cdot (n-1)}$. $\square$

**Remark 3.1.** Corollary 3.2 provides also a short proof of Theorem 3.1, since

$$ \tilde{a}(n) = 2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)} \le 2^n \cdot (1 + 2) + 1. \quad (25) $$

Thus, $\sqrt{5^n - 1} > 3 \cdot 2^n + 1$ holds for any $n \ge 10$.

**Corollary 3.3.** $\forall n \in \mathbb{N} - \{0, 1\}$ and $\forall k \in \mathbb{N}_0$,

$$ A_5(n) = ((2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)}) \vee (2^n \cdot ((-1)^n + 8) + i^{n \cdot (n-1)})) + k \cdot 10 \cdot 2^n. \quad (26) $$

**Proof.** Equation 5 and Corollary 3.2 (Berselli's formula) imply that

$$ A_5(n) = 2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)} + k \cdot 10 \cdot 2^n \\ \cup \begin{cases} 2^n \cdot (5 + 2 \cdot \sin(\frac{\pi \cdot n}{2}) + 4 \cdot \cos(\frac{\pi \cdot n}{2})) + 1 + k \cdot 10 \cdot 2^n & \text{iff } n \equiv \{0, 1\} \pmod 4 \\ 2^n \cdot (5 - 2 \cdot \sin(\frac{\pi \cdot n}{2}) - 4 \cdot \cos(\frac{\pi \cdot n}{2})) - 1 + k \cdot 10 \cdot 2^n & \text{iff } n \equiv \{2, 3\} \pmod 4 \end{cases} $$

Since, $\forall n \ge 2$, it is easy to verify (as shown in the proof of the aforementioned Corollary 3.2) that

$$ 
\begin{cases} 
2^n \cdot (5 + 2 \cdot \sin(\frac{\pi \cdot n}{2}) + 4 \cdot \cos(\frac{\pi \cdot n}{2})) + 1 & \text{iff } n \equiv \{0, 1\} \pmod 4 \\ 
2^n \cdot (5 - 2 \cdot \sin(\frac{\pi \cdot n}{2}) - 4 \cdot \cos(\frac{\pi \cdot n}{2})) - 1 & \text{iff } n \equiv \{2, 3\} \pmod 4 
\end{cases} \\
= 2^n \cdot (2^3 + \cos(\pi \cdot n) + i \cdot \sin(\pi \cdot n)) + \cos\left(\frac{\pi \cdot n \cdot (n-1)}{2}\right) + i \cdot \sin\left(\frac{\pi \cdot n \cdot (n-1)}{2}\right) \\
= 2^n \cdot ((-1)^n + 8) + i^{n \cdot (n-1)}, \text{ the statement of Corollary 3.3 follows.} \quad \square
$$
# 4 The constant congruence speed of the prime numbers

The set of the prime numbers is very important in many fields of mathematics due to the fundamental theorem of arithmetic (in particular it is central in number theory, computer sciences, and cryptography), so we are interested in knowing if the constant congruence speed of any base which is a prime number maps to every (arbitrarily large) value $V(a) \in \mathbb{N} - \{0\}$.

**Definition 4.1.** Let $a \in \mathbb{N} - \{0\}$ not be a multiple of 10. $\mathbb{P} = \{p \in \mathbb{N} : p \text{ is prime}\} = \{a : a \text{ is prime}\}$ indicates the set of prime numbers (the last equality holds since 1 and every multiple of 10 cannot be prime).

**Definition 4.2.** $\widehat{\mathbb{A}} = \{(k+1) \cdot 10^n - 1) \in \mathbb{P} : n \in \mathbb{N} - \{0\} \wedge k \in \mathbb{N}_0\}$ and $\overline{\mathbb{A}} = \{(2 \cdot k + 1) \cdot 10^n - 1) \in \mathbb{P} : n \in \mathbb{N} - \{0\} \wedge k \in \mathbb{N}_0\}$, so $\overline{\mathbb{A}} \subseteq \widehat{\mathbb{A}} \subset \mathbb{P}$. Additionally, let $\widehat{a} := (k+1) \cdot 10^n - 1$ and let $\overline{a} := (2 \cdot k + 1) \cdot 10^n - 1$. Furthermore, let $\widehat{a}^* \in \widehat{\mathbb{A}}$ represents the generic element of $\widehat{\mathbb{A}}$ and (similarly) let $\overline{a}^* \in \overline{\mathbb{A}}$ be the generic element of $\overline{\mathbb{A}}$.

In order to confirm that the set $\{V(p) : p \in \mathbb{P}\}$ is not bounded above, let us firstly introduce the following lemma.

**Lemma 4.3.** If $b$ is sufficiently large to guarantee $V(\widehat{a}, b) = V(\widehat{a})$, then $V(\widehat{a}) \ge n$, $\forall n \in \mathbb{N} - \{0\}$. In particular, assuming $n \ne 1$, $V(\widehat{a}) = n \Leftrightarrow k \not\equiv 9 \pmod{10}$.

*Proof.* Let $n \ge 2$. The statement easily follows from Equation (7), since $n \ge 2 \Rightarrow V(10^n - 1 + k \cdot 10^n) = n$ for every $k \ne 9 \pmod{10}$, while $k \equiv 9 \pmod{10} \Rightarrow \widehat{a} \equiv (10^{n+1} - 1) \pmod{10^{n+1}}$ for any $n$ as above. Thus, $k \equiv 9 \pmod{10} \Leftrightarrow \widehat{a}^*$ belongs to $\mathbb{A}_9(n+c)$, where $c \in \mathbb{N} - \{0\}$.

If $n=1, \forall k \in \mathbb{N}_0$, $\widehat{a}(k) \equiv \{4, 9, 14, 19, 24\} \pmod{25}$. Consequently [16], $V(\widehat{a}(k)) > 1$ if and only if $\widehat{a}(k) \equiv 24 \pmod{25}$.

Hence, $V(\widehat{a}(k)) \ne 1$ for any $k \equiv 4 \pmod{5}$, including the case $k \equiv 4 \pmod{10}$.

Therefore, for any $n \ge 2$, we have shown that $V(\widehat{a}) = n \Leftrightarrow k \ne 9 \pmod{10}$, while $n = 1 \Rightarrow V(\widehat{a}(k)) = n$ if and only if $k \ne 4 \pmod{5}$; since, $\forall n \in \mathbb{N} - \{0\}$, $k \equiv 4 \pmod{5} \Rightarrow V(\widehat{a}(k)) \ge n$, the proof of Lemma 4.3 is complete. $\square$

**Conjecture 4.1.** $\forall \widehat{a}^* \in \widehat{\mathbb{A}}, b \ge 2 \Rightarrow V(\widehat{a}^*, b) = V(\widehat{a}^*)$.

**Remark 4.1.** In order to show that $\exists \widehat{a}^* \in \widehat{\mathbb{A}} : V(\widehat{a}^*, 1) \ne V(\widehat{a}^*, 2) = V(\widehat{a}^*)$, we note that, for any given pair $j \in \mathbb{N} - \{0\}$ and $n \in \mathbb{N} - \{0, 1\}$, $V((10^n - 1)^{5j}, 1) \ne V((10^n - 1)^{5j}, 2) = V((10^n - 1)^{5j})$ (see [15], p. 25). Thus, as a random choice, it is sufficient to take any prime number of the form $c \cdot 10^{10} + (10^2 - 1)^5$, $c \in \mathbb{N} - \{0\}$, such as $2 \cdot 10^{10} + (10^2 - 1)^5 = 295099005 \cdot 10^2 - 1 = 29509900499 \in \widehat{\mathbb{A}}$. Since $V(29509900499, 1) = 3 \ne 2 = V(29509900499, 2)$, $b$ have to be greater than 1.
Checking for smaller candidates than $\hat{a}^* = c \cdot 10^{10} + 99^5$, by Hensel's lifting lemma, we can also see that any odd power of $499 \in \hat{\mathbb{A}}$ is congruent modulo $10^3$ to $499$, so $499^{499} \equiv 499 (\text{mod } 10^3)$ and $3 = V(499, 1) \neq V(499, 2) = V(499) = 2$ still holds.

**Theorem 4.4.** $\forall a \neq 0 (\text{mod } 10), \exists^\infty \hat{a}^* \in \mathbb{P} : V(\hat{a}^*) \geq V(a)$.

*Proof.* Since $V(a)$ indicates the constant congruence speed of $a$ (by Definition 1.1, we are allowed to assume the sufficient but not necessary condition $b \ge a+1$), it follows that $a \neq 0 (\text{mod } 10) \Rightarrow V(a) \in \mathbb{N}_0$.

Let us invoke Dirichlet's theorem on arithmetic progressions [17, 18], which implies that $\forall (t, d)$ such that $\text{gcd}(t, d) = 1$, there is an infinite number of primes of the form $t + m \cdot d$, where $m \in \mathbb{N}_0$.

Now, for any $j \in \mathbb{N} - \{0\}$, let $t := t(j)$, and similarly let $d := d(j)$. In particular, assume (without loss of generality) $t(j) = 10^j - 1$ and $d(j) = 10^j$, since it is trivial to point out that $10^j = 2^j \cdot 5^j$, so $2 \nmid (10^j - 1) \land 5 \nmid (10^j - 1)$.

By Lemma 4.3, we can state that $\hat{a} = t(j) + m \cdot d(j)$ is always characterized by a constant congruence speed $V(\hat{a}) \ge j$.

Anyway, in order to clearly show that $V(\hat{a}) \ge j$ holds, let $x_i \in \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}$. Hence,

$$ \hat{a} = \sum_{i=j}^{h} x_i \cdot 10^i + 10^j - 1 = x_{h-x_{(h-1)}} \dots x_{(j+1)} - x_j - 9 - 9 - \dots - 9 - 9 \quad (27) $$

so that it is evident that $V(\hat{a})$ only depends on the length of the rightmost repunit (9's) of $10^j < \hat{a} < 10^{h+1}$.

Thus, picking any $a \ge 2$ such that $V(a)$ is arbitrarily large, we have shown that there always exist infinitely many prime numbers $\hat{a}^* \equiv 9 (\text{mod } 10)$ which are characterized by $V(\hat{a}^*) \ge V(a) (x_j \neq 9 \Rightarrow V(\hat{a}^*) = V(a) = j$, see Equation (27)).

Lastly, $a = 1 \Leftrightarrow V(a) = 0$ (see Reference [16], Definition 2), so $V(\hat{a}^*) > V(1)$ for any $\hat{a}^* \in \mathbb{P}$.

Therefore, we can write that $\forall V(a) \in \mathbb{N}, \exists \hat{a}^* \in \mathbb{P} : V(\hat{a}^*) \ge V(a)$, and this concludes the proof of Theorem 4.4 (since $a \neq 0 (\text{mod } 10) \Rightarrow V(a, b) = V(a) \in \mathbb{N}_0, \forall b > a)$. $\square$

**Corollary 4.5.** $\forall V(a) \in \mathbb{N}_0, \exists^\infty \hat{a}^* \in \mathbb{P} : V(\hat{a}^*) > V(a)$.

*Proof.* In order to prove this corollary of Theorem 4.4, it is sufficient to take $n = V(a) + 1$, so we have $\hat{a} = (k+1) \cdot 10^{V(a)+1} - 1$ (by Definition 4.2).

Thus, $V(\hat{a}) \ge V(a) + 1$ is satisfied for any $V(a), k \in \mathbb{N}_0$.

It follows that $V(\hat{a}^*) > V(a)$, and (by Dirichlet's theorem on arithmetic progressions) we know that there are infinitely many bases $\hat{a}^* \in \hat{\mathbb{A}} \subset \mathbb{P}$. $\square$

**Theorem 4.6.** $\forall a \neq 1 : a \neq 0 (\text{mod } 10), \exists^\infty \bar{a}^* \in \mathbb{P} : V(\bar{a}^*) = V(a)$.
*Proof.* ($a \neq 1 \wedge a \neq 0 \pmod{10}$) $\Rightarrow V(a) \in \mathbb{N} - \{0\}$ [16]. By Dirichlet's theorem on arithmetic progressions, $\gcd(t, d) = 1 \Rightarrow \exists^{\infty}(t + m \cdot d) \in \mathbb{P}$, where $m \in \mathbb{N}_0$. Let $t(j) = 10^j - 1$ and $d(j) = 2 \cdot 10^j$ be defined for every $j \in \mathbb{N} - \{0\}$. Since $2 \cdot 10^j = 2^{j+1} \cdot 5^j$ and $10^j - 1 \equiv 9 \pmod{10}$, $\gcd(t(j), d(j)) = 1$ (noticing again that $2 \nmid (10^j - 1) \wedge 5 \nmid (10^j - 1)$).

Consequently, the arithmetic progression $t(j)+m \cdot d(j) = 10^j - 1 + 2 \cdot m \cdot 10^j = (2 \cdot m + 1) \cdot 10^j - 1$ contains infinitely many primes. Since, $\forall m, 10 \nmid (2 \cdot m + 1)$, $t(j) + m \cdot d(j) = \sum_{i=j}^{h} x_i \cdot 10^i + 10^j - 1 = x_h - x_{(h-1)} - \dots - x_{(j+1)} - x_j - 9 \cdot 9 - \dots - 9 \cdot 9$, where $x_j \in \{0, 2, 4, 6, 8\}$. By Equation (7), for any given $j \ge 2$, it follows that $V((2 \cdot m + 1) \cdot 10^j - 1) = j$ holds for all integers $m \ge 0$.

Finally, if $V(a) = 1$, then let $m \equiv 1 \pmod{10}$. Dirichlet's theorem on arithmetic progressions implies the existence of infinitely many primes congruent modulo 100 to 29, and we know that all of them have a unitary constant congruence speed (since $29 \equiv 4 \pmod{25}$), $a \equiv 4 \pmod{25} \Rightarrow V(a) = 1$. It follows that $\exists^{\infty}c \in \mathbb{N}_0$ such that $((c \cdot 20 + 3) \cdot 10 - 1) \in \overline{\mathbb{A}}$. Since $V((c \cdot 20 + 3) \cdot 10 - 1) = 1$ for every $c$, we have just proved that $\forall c \in \mathbb{N}_0 : ((c \cdot 20 + 3) \cdot 10 - 1) \in \mathbb{P}, \exists \overline{a}^*(c) \in \overline{\mathbb{A}} : V(\overline{a}^*(c)) = 1$.

Thus, $\forall j \in \mathbb{N} - \{0\}, \exists^{\infty}m \in \mathbb{N}_0 : ((2 \cdot m + 1) \cdot 10^j - 1) \in \mathbb{P} \wedge V((2 \cdot m + 1) \cdot 10^j - 1) = j$, and this completes the proof of Theorem 4.6. $\square$

Theorem 4.6 entails the existence of an infinite sequence of primes, which we indicate as $\{q_n\}$, defined by the smallest prime numbers characterized by a constant congruence speed of $n \in \mathbb{N} - \{0\}$.

More specifically, $\{q_n\} = 2, 5, 193, 1249, 22943, 2218751, \dots$ is not a monotonic sequence, because $q_{20} = 3640476581907922943 < 23640476581907922943 = q_{19}$, and also $q_{54} = (2 \cdot 5^{252} - 1) \pmod{10^{52}} < q_{52} = -(5^{252} + 2^{552}) \pmod{10^{52}} < q_{53} = 2 \cdot 10^{53} - 1$ (see Table 2).

As an exercise, we can try to bound the value of $q_{1762063}$. Since Theorem 4.6 implies that $q_{1762063} \in \mathbb{N}$, let us find a lower bound from the inequalities stated in Section 2.2, and in particular we get $q_{1762063} > \sqrt{5^{1762063} - 1}$. From [1], we know that $9 \cdot 10^{1762063} - 1 = \sum_{j=1762063}^{1762063} 8 \cdot 10^j + 10^{1762063} - 1$ is prime, and $9 \cdot 10^{1762063} - 1 = 9 \cdot 10^{V(9 \cdot 10^{1762063} - 1)} - 1$ has a constant congruence speed of 1762063. It follows that $\sqrt{5} \cdot 5^{881031} < q_{1762063} \le 9 \cdot 10^{1762063} - 1$ (since $2 \nmid n \in \mathbb{N} - \{0\} \Rightarrow \sqrt{5^n} \notin \mathbb{N}$).
(mod 10) whose constant congruence speed is equal to any given positive integer. Since $\tilde{a}(0) = 1$, $\tilde{a}(1) = 2$, and $\tilde{a}(V(a) : V(a) \ge 2) = 2^n \cdot ((-1)^{n-1} + 2) - i^{n \cdot (n-1)}$ [14], we can finally conclude that the conjecture stated in Reference [16] is true.

In Section 4, for any $n \in \mathbb{N} - \{0\}$, we also proved the existence of infinitely many prime numbers with a constant congruence speed of $n$, defining the related sequence $\{q_n\}$ of the smallest primes such that $V(q(n)) = n$, and consequently showing that $\{q_n\}$ is not monotonic.

In the present paper we have only considered radix-10, but our results can be clearly extended to different numeral systems, as shown by [2] which was inspired by [19]; this observation suggests a topic for the next research article.

## Acknowledgements

The author is very much thankful to the anonymous referees of *Notes on Number Theory and Discrete Mathematics* whose comments and valuable suggestions have substantially improved the correctness and the overall quality of this paper.

## References

[1] C. K. Caldwell. $9 \cdot 10^{1762063} - 1$. In *Largest Known Primes*, PrimePages, 2020. https://primes.utm.edu/primes/page.php?id=131054. Accessed on Dec. 10 2020.

[2] J. Germain. On the Equation $a^x \equiv x \pmod b$. *Integers: Learning, Memory, and Cognition*, 9(6):629–638, 2009.

[3] Googology Wiki contributors. *Tetration*. In *Hyper operators*, Googology Wiki – Fandom, Updated on May 8 2020. https://googology.wikia.org/wiki/Tetration. Accessed on 10 Dec. 2020.

[4] Lubin & Mario. *Why are p-adic numbers and p-adic integers only defined for p prime?* In *All Questions*, Mathmathics Stack Exchange, Updated on Sep. 9 2016. https://math.stackexchange.com/questions/1919274. Accessed on 10 Dec. 2020.

[5] K. Mahler. Part 1: $g$-adic Numbers and Roth's theorem. In *Lectures on Diophantine Approximations*. University of Notre Dame Press, 1961.

[6] G. P. Michon. *Polyadic Arithmetic*. In *Final Answers*, Numericana, 2006. http://www.numericana.com/answer/p-adic.htm. Accessed on Dec. 10 2020.

[7] OEIS Foundation Inc. Sequence A224473 in the On-line Encyclopedia of Integer Sequences, 2013. https://oeis.org/A224473. Accessed on Aug. 27 2020.

[8] OEIS Foundation Inc. Sequence A224474 in the On-line Encyclopedia of Integer Sequences, 2013. https://oeis.org/A224474. Accessed on Aug. 27 2020.