Solution to the Erdős problem on distinct residues of factorials


Abstract

Paul Erdős posed the following question: Is there a prime number \(p>5\) such that the residues of \(2!\), \(3!\),…, \((p-1)!\) modulo \(p\) all are distinct. In this study, we give the negative answer on this question in an elementary way.

12 3 4 5

1 Introduction↩︎

Paul Erdős posed the following question: Is there a prime number \(p>5\) such that the residues of \(2!\), \(3!\),…, \((p-1)!\) modulo \(p\) all are distinct. Trudgian [1] called prime numbers satisfying this property socialist primes. For the primes having the form \(p=3 \;(\mathrm{mod}\;4)\), the answer on this question is negative, due to Wilson’s theorem and elementary modular arithmetic. Recall that Wilson’s theorem states that a natural number \(n > 1\) is a prime number if and only if \((n-1)!\equiv-1(\mathrm{mod}\;n)\), see [2]. According to elementary modular arithmetic, along with \((p-1)!\equiv-1(\mathrm{mod}\;p)\) we also have \((p-2)!\equiv1(\mathrm{mod}\;p)\) and in the case of \(p=3 \;(\mathrm{mod}\;4)\), \(\left[\left(\frac{p-1}{2}\right)!\right]^2\equiv1(\mathrm{mod}\;p)\) (see relation 1 below or [3]). Thus the question of Paul Erdős generally reduces to the case of primes having the presentation \(p=1 \;(\mathrm{mod}\;4)\).

The problem of the existence of socialist primes remains unsolved and appears in the list of unsolved problems in number theory in [4]. Several studies have been conducted this problem. In all these studies the authors found the conditions on prime numbers, under which the answer can be positive. The complexity of those conditions made hard to answer the question whether such primes exist.

The first study was conducted by Rokowska and Schnitzel [5] in 1960. They proved that if \(p\) exists, then it should satisfy the following conditions \(\quad p=5 (\mathrm{mod}\;8),\quad \left(\frac{5}{p}\right)=-1, \quad \left(\frac{-23}{p}\right)=1.\) Recall that \(\big(\frac{a}{p}\big)\) denotes Legendre’s symbol, \(\big(\frac{a}{p}\big)\equiv a^{\frac{p-1}{2}}(\mathrm{mod}\;p)\) and can take the values \(\{-1, 0, 1\}\), see [6]. Based on the aforementioned conditions, they showed numerically that there are no prime numbers satisfying the aforementioned property in the interval between \(5\) and \(1000\). In addition to that Rokowska and Schnitzel [5] also proved that if a socialist prime \(p\) exists, then for that \(p\) none of the numbers \(2!\), \(3!\),…, \((p-1)!\) is congruent modulo \(p\) to \(-\left(\frac{p-1}{2}\right)!\).

Extending the study of [5], Trudgian [1] assumed additionally that either \(\left(\frac{1957}{p}\right)=1\), or \(\left(\frac{1957}{p}\right)=-1\) with \(\left(\frac{4y+25}{p}\right)=-1\) for all \(y\) satisfying the equation \(y(y+4)(y+6)-1\equiv0 \;(\mathrm{mod}\;p).\) By numerical calculations, he confirmed that socialist primes less than \(10^9\) do not exist.

Andrejić and Tatarević [7], [8] also studied the problem of socialist primes, where they established a connection with left factorial function as well as provided intensive numerical studies of residues confirming that socialist primes less than \(10^{11}\) do not exist.

All of the aforementioned studies [1], [5], [7] were based on the direct analysis of residues, and the study that started in [5] was then developed in [1] and [7] following the same basic idea to find the conditions on primes, under which the required prime may exist.

The proof presented in this study is based on another idea. Unlike the previous studies, our study is not based on analysis of residues for the undecided cases. We prove that the known identities that follow from Wilson’s theorem and modular arithmetic (see identities 1 below) contradict to the claim that for any \(p>5\) the residues modulo \(p\) of \(\{2!, 3!,\ldots, (p-1)!\}\) are distinct. First we formulate and prove a closely related problem that then adapted to the problem formulated by Erdős. Our proof is fully based on combinatorial arguments.

Our main result is the following theorem.

Theorem 1. There are no socialist prime numbers.

This theorem is proved in the following section.

2 Proof of Theorem 1↩︎

2.1 Auxiliary problem↩︎

Recall the known identities based on Wilson’s theorem and modular arithmetic: \[\label{1} \begin{align} (p-1)!&=-(p-2)!=2!(p-3)!=-3!(p-4)!=...\\ &=(-1)^{i-1}(i-1)!(p-i)!=\ldots\\ &=(-1)^{\frac{p-1}{2}}\left(\frac{p-1}{2}\right)!\left(\frac{p-1}{2}\right)!\equiv{-1}\;(\mathrm{mod}\;p). \end{align}\tag{1}\]

Our aim is to prove that if the residues modulo \(p\) of \(\{2!, 3!,\ldots, (p-1)!\}\) are distinct, then 1 is impossible.

To prove this, we first solve the following auxiliary problem.

Let \(\big\{\alpha_1, \alpha_2,\ldots, \alpha_{\frac{p-1}{2}}\big\}\) and let \(\big\{\beta_1, \beta_2,\ldots, \beta_{\frac{p-1}{2}}\big\}\) be the two subsets of \(I=\{1,2,\ldots,p-1\}\) satisfying the properties \[\begin{align} \big\{\alpha_1, \alpha_2,\ldots, \alpha_{\frac{p-1}{2}}\big\}\cup \big\{\beta_1, \beta_2,\ldots, \beta_{\frac{p-1}{2}}\big\}&=& I, \\ \big\{\alpha_1, \alpha_2,\ldots, \alpha_{\frac{p-1}{2}}\big\}\cap \big\{\beta_1, \beta_2,\ldots, \beta_{\frac{p-1}{2}}\big\} &=& \emptyset, \end{align}\] and specified as \[\label{2} \alpha_i\beta_i=(-1)^i\;(\mathrm{mod}\;p), \quad i=1, 2,\ldots, \frac{p-1}{2}.\tag{2}\] Our first aim is to find the values \(p\) under which 2 is consistent, and describe the structure of systems of equalities that provides this consistency.

Our study is conducted under the assumption \(p=1\;(\mathrm{mod}\;4)\). The obtained results will be then applied to the residues modulo \(p\) of \(\{2!\), \(3!,\ldots\), \((p-1)!\}\) that according to 1 behave similarly.

We prove the following result.

Proposition 2. Assume that \(p=1\;(\mathrm{mod}\;4)\). Then, under an appropriate choice of \(\alpha_i\) and \(\beta_i\) in 2 , the system of equalities is consistent if and only if \(p=5\;(\mathrm{mod}\;8)\).

Proof. The proof is structured into three sections. In the first section, we describe the structure of the system of equalities 2 . In the second and third sections we study the cases \(p=1\;(\mathrm{mod}\;8)\) and \(p=5\;(\mathrm{mod}\;8)\), respectively.

1. Basic structure of the system of equalities. Notice first that if \(\alpha_1=1\), then \(\beta_1\) must be equal to \(p-1\) and the right-hand side must be \(-1 \;(\mathrm{mod}\;p)\). Therefore if we split the system of equalities 2 into two separate subsystems: \[\label{3} \alpha_{2i}\beta_{2i}=1 \;(\mathrm{mod}\;p),\quad i=1, 2,\ldots, \frac{p-1}{4},\tag{3}\] and \[\label{4} \alpha_{2i-1}\beta_{2i-1}=-1 \;(\mathrm{mod}\;p), \quad i=1, 2,\ldots, \frac{p-1}{4},\tag{4}\] then the aforementioned identity belongs to 4 . If we exclude this identity from consideration, we would have \(\frac{p-1}{2}-1\) remaining equalities in total, \(\frac{p-1}{4}\) of which satisfying 3 and the rest \(\frac{p-1}{4}-1\) satisfying 4 . We will show below that one of \(\frac{p-1}{4}\) equalities of 3 has a specific form and can be excluded from consideration as well. We will call it tag equality. That is, 3 consists of a tag equality and \(\frac{p-1}{4}-1\) other (regular) equalities. The tag equality, marked as \[\alpha_{\frac{p-1}{2}}\beta_{\frac{p-1}{2}} = 1\;(\mathrm{mod}\;p),\] will be discussed later. Let us now discuss the properties of the remaining systems of equalities \[\label{12} \alpha_{2i}\beta_{2i}=1 \;(\mathrm{mod}\;p), \quad i=1, 2,\ldots, \frac{p-5}{4},\tag{5}\] and \[\label{13} \alpha_{2i+1}\beta_{2i+1}=-1 \;(\mathrm{mod}\;p), \quad i=1, 2,\ldots, \frac{p-5}{4}.\tag{6}\]

Notice that if for some \(i_0\), \[\label{14} \alpha_{i_0}\beta_{i_0}=1 \;(\mathrm{mod}\;p),\tag{7}\] then also \[\label{15} (p-\alpha_{i_0})(p-\beta_{i_0})=1 \;(\mathrm{mod}\;p).\tag{8}\] Similarly, if \[\label{16} \alpha_{i_1}\beta_{i_1}=-1 \;(\mathrm{mod}\;p),\tag{9}\] then also \[\label{17} (p-\alpha_{i_1})(p-\beta_{i_1})=-1 \;(\mathrm{mod}\;p).\tag{10}\] According to the assumption, all \(\alpha_i\) and \(\beta_i\) that appear in 5 and 6 must be distinct. Therefore after changing the variables, \(\tilde{\alpha}_{i_0}=p-\alpha_{i_0}\), \(\tilde{\beta}_{i_0}=p-\beta_{i_0}\), \(\tilde{\alpha}_{i_1}=p-\alpha_{i_1}\) and \(\tilde{\beta}_{i_1}=p-\beta_{i_1}\) are new distinct values.

Let us now discuss the tag equality. The tag equality is a specific equality that has the form: \[\alpha_{\frac{p-1}{2}}\left(p-\alpha_{\frac{p-1}{2}}\right) = 1\;(\mathrm{mod}\;p).\] and it is a stand-along equality. It cannot be a part of the system of equalities 7 and 8 , since if it satisfies 7 it is also satisfies 8 . We prove below that it is a unique equality in the system of equalities 3 .

For specification of the tag equality, we consider the equation \[\label{20} i(p-i)=Kp+1\tag{11}\] for \(K\) and \(i\). This equation reduces to \[K=i-\frac{i^2+1}{p},\quad 2\leq i\leq p-2.\] Apparently that \(K\) takes integer value in the only case when \(i^2=-1\;(\mathrm{mod}\;p)\). Such value \(i\) exists and is unique, if we dismiss another value \((p-i)^2=-1\;(\mathrm{mod}\;p)\) satisfying the same properties due to the symmetry. That is, there is exactly one equality satisfying 11 , and the tag equality is strictly unique in the system of equalities 2 or 3 .

For the further studies of 5 and 6 we consider the two cases given below.

2. Case of \(p=1\;(\mathrm{mod}\;8)\). Now we study the case of \(p=1\;(\mathrm{mod}\;8)\). In this case, \(\frac{p-1}{4}\) is even. Then \(\frac{p-1}{4}-1\) is odd, and each of the systems of equalities 5 , 6 contains the odd number of equalities. This means that there exists \(i_0\) such that the system of equalities 5 contains 7 and does not contain 8 .

Then instead of 8 we must have \[\label{18} \alpha_{i_0}(p-\beta_{i_0}) = -1 \;(\mathrm{mod}\;p)\tag{12}\] or \[\label{18461} (p-\alpha_{i_0})\beta_{i_0} = -1 \;(\mathrm{mod}\;p)\tag{13}\]

However both \(p-\beta_{i_0}\) and \(p-\alpha_{i_0}\) appear in 8 , and therefore in both 5 and 6 .

We arrived at the contradiction that shows that the system of equalities cannot be consistent.

3. Case of \(p=5\;(\mathrm{mod}\;8)\). In this case, \(\frac{p-1}{4}\) is odd. Then \(\frac{p-1}{4}-1\) is even, and each of the systems of equalities 5 , 6 contains the even number of equalities. This case is more complex. To resolve this case, we introduce a notion of perfect system.

The system of identities \[\begin{align} \alpha_2\gamma_2&\equiv&1\;(\mathrm{mod}\;p),\nonumber\\ \alpha_3\gamma_3&\equiv&1\;(\mathrm{mod}\;p),\nonumber\\ \ldots &\equiv&\ldots,\label{21}\\ \alpha_{\frac{p-3}{2}}\gamma_{\frac{p-3}{2}}&\equiv&1\;(\mathrm{mod}\;p)\nonumber \end{align}\tag{14}\] is called perfect system. Apparently this system exists and unique. For any \(\alpha_i\), \[\gamma_i:=\frac{K_ip+1}{\alpha_i},\] where \(K_i\) is the smallest positive integer given such that the left-hand side of the equality is integer, \(1\leq K_i\leq\alpha_i-1\).

The system of identities 14 contains \(2\left(\frac{p-1}{4}-1\right)\) identities, that is, all the identities except the first one, where \(\alpha_1=1\) (or \(\alpha_1=p-1\)) and the tag equality. The numeration of the indices coincides with that given in the joint system of equalities 5 and 6 . The system of identities 14 is strongly unique, all \(\alpha_i\) and \(\gamma_i\) are distinct. Indeed, with \(\alpha_{i_0}\neq\alpha_{i_1}\), we obviously have \(\gamma_{i_0}\neq\gamma_{i_1}\). If we assume in contrary that \(\gamma_{i_0}=\gamma_{i_1}\), then we easily arrive at the contradiction by subtracting the equalities. As well, \(\alpha_i\), \(i\geq3\), is chosen such that \(\alpha_i\) distinguishes from all of the previous values \(\alpha_j\) and \(\gamma_j\), \(2\leq j\leq i-1\).

The system is called perfect, because all the \(\alpha_i\) and \(\gamma_i\) in this system are distinct and the system itself is unique. Note that the similar perfect system can be built for identities, in which the right-hand side is equal to \(-1 \;(\mathrm{mod}\;p)\).

Now, in order to get 5 and 6 from 14 , we separate half of the equalities from 14 and multiply both sides there by \(-1\) given that each half (subsystem) is constructed according to the rule: if 7 belongs to the subsystem, then also 8 does. Similarly, if 9 belongs to the other subsystem, then also 10 does. With closed subsystems, 5 and 6 are fully separated and the system of equalities is consistent.

More specific explanation is as follows. We take the first identity in 14 and transform it as follows \[\alpha_2(p-\gamma_2)=\alpha_2\tilde{\gamma_2}\equiv-1\;(\mathrm{mod}\;p).\] Then, \[(p-\alpha_2)\gamma_2=\tilde{\alpha_2}\gamma_2\equiv-1\;(\mathrm{mod}\;p).\] Thus instead of the original two identities \[\begin{align} \alpha_2\gamma_2 &\equiv& 1\;(\mathrm{mod}\;p), \\ \tilde{\alpha}_2\tilde{\gamma}_2 &\equiv& 1\;(\mathrm{mod}\;p), \end{align}\] we get \[\begin{align} \alpha_2\tilde{\gamma_2} &\equiv& -1\;(\mathrm{mod}\;p), \\ \tilde{\alpha_2}\gamma_2 &\equiv& -1\;(\mathrm{mod}\;p). \end{align}\] That is in both of the cases the same set of four parameters \(\alpha_2\), \(\gamma_2\), \(\tilde{\alpha}_2\) and \(\tilde{\gamma}_2\) is used. This procedure continues similarly with other quantities until getting a half part of all quantities transformed and collected in the subsystem. ◻

Remark 3. According to the construction in the proof of Proposition 2, the system of equalities 2 to be consistent, must be originated from the perfect system of identities, according to the rules established in the proof. That is, we originally must have 14 or the other equivalent perfect system with right-hand sides \(-1 \;(\mathrm{mod}\;p)\) and with integers \(\alpha_i\) and \(\gamma_i\). The possible number of consistent systems of equalities originated from the perfect system is \[\binom{\frac{p-5}{4}}{\frac{p-5}{8}}.\]

Remark 4. Apparently that together with 14 , \[\alpha_i^\prime\gamma_i^\prime\equiv 1\;(\mathrm{mod}\;p), \quad i=2, 3,\ldots, \frac{p-3}{2},\] with \(\alpha_i^\prime:=\prod_{j=2}^{i}\alpha_j\), \(\gamma_i^\prime:=\prod_{j=2}^{i}\gamma_j\), is a perfect system as well.

2.2 The final part of the proof of Theorem 1↩︎

Our further goal is to adapt the statement of Proposition 2 to the residues modulo \(p\) of the values \(\{2!, 3!,\ldots, (p-1)!\}\). The number of residues is \(p-2\). If the aforementioned residues of \(\{2!, 3!,\ldots, (p-1)!\}\) all are distinct, then it is known [1], [5] that the missing residue is \(r=-\big(\frac{p-1}{2}\big)! \;(\mathrm{mod}\;p)\) that is not congruent to any of \(\{2!, 3!,\ldots, (p-1)!\}\). So, we are to complement our set with this additional value. Then the last equality in 1 , \[\left(\frac{p-1}{2}\right)!\left(\frac{p-1}{2}\right)!\equiv{-1}(\mathrm{mod}\;p)\] is to be replaced by \[r\left(\frac{p-1}{2}\right)!\equiv{1}\;(\mathrm{mod}\;p),\] and instead of 1 we have the following system of identities (rewritten here in a more convenient form): \[\begin{align} 2!(p-3)! &\equiv&-1\;(\mathrm{mod}\;p),\nonumber\\ 3!(p-4)! &\equiv&+1\;(\mathrm{mod}\;p),\nonumber\\ \cdots&\equiv&\cdots\label{24}\\ (i-1)!(p-i)!&\equiv&(-1)^i\;(\mathrm{mod}\;p),\nonumber\\ \cdots&\equiv&\cdots\nonumber\\ \left(\frac{p-3}{2}\right)!\left(\frac{p+1}{2}\right)!&\equiv&+1\;(\mathrm{mod}\;p),\nonumber \end{align}\tag{15}\] with the two additional identities: \[\begin{align} (p-1)!(p-2)!&\equiv&-1 \;(\mathrm{mod}\;p),\tag{16}\\ r\left(\frac{p-1}{2}\right)!&\equiv&{+1}\;(\mathrm{mod}\;p)\tag{17}. \end{align}\] That is, we have \(\frac{p-1}{2}\) identities in total.

Now we are to consider the two cases of \(p=1\;(\mathrm{mod}\;8)\) and \(p=5\;(\mathrm{mod}\;8)\).

In the case of \(p=1\;(\mathrm{mod}\;8)\), the statement of Theorem 1 follows directly from Proposition 2. It this case, the residues modulo \(p\) of \(\{2!\), \(3!\),…, \((p-1)!\}\) cannot be distinct, since then the system of equalities 1517 must be inconsistent. But it is consistent, hence, due to the contradiction, the fact that the residues modulo \(p\) of \(\{2!\), \(3!\),…, \((p-1)!\}\) are distinct is incorrect.

The case \(p=5\;(\mathrm{mod}\;8)\) is more complex and needs to be discussed in more detail. Here we apply our findings in this case under the proof of Proposition 2. With \((p-2)!=1\;(\mathrm{mod}\;p)\) and \((p-1)!=-1\;(\mathrm{mod}\;p)\), identity 16 should be dismissed. The role of identity 17 is the tag identity. It should be dismissed too. Therefore we study 15 . Let us return to the perfect system of identities 14 . Apparently that when \(\alpha_l=i\), then \(\gamma_l\) in 14 must have the presentation \[\label{28} \gamma_l =\frac{K_lp+1}{i}\tag{18}\] for the smallest \(K_l\) given such that \(\gamma_l\) is a positive integer.

Let us now obtain the similar type system from 15 . We have \[\label{26} (i-1)!(p-i)!\equiv(-1)^i \;(\mathrm{mod}\;p), \quad i=3, 4,\ldots, \frac{p-1}{2}.\tag{19}\]

Dividing the \(i\)th identity by \(i-1\)st one, we obtain \[\label{27} i\gamma_i=i\cdot\frac{1}{p-i}\equiv-1 \;(\mathrm{mod}\;p), \quad i=2, 3,\ldots, \frac{p-3}{2}.\tag{20}\] Multiplying the both sides of 20 by \(-1\), we obtain \[\label{30} i\gamma_i=i\cdot\frac{1}{i}\equiv1 \;(\mathrm{mod}\;p), \quad i=2, 3,\ldots, \frac{p-3}{2}.\tag{21}\] As we can see, the systems of identities 14 and 19 are distinct. In the system of identities 14 all \(\gamma_i\) are integer and distinct, and the system of equations 14 can be easily transformed to the consistent system of equalities 2 as it was proved in Proposition 2. In the system of identities 21 , \(\gamma_i=i^{-1}\) are fractions, and the system itself is trivial. That is, the identities for \(\gamma_i\) are obtained by substitution \(K_i\equiv0\) for all \(i\) in 18 . That is, the system of identities 21 does not satisfy the required condition to be perfect. Following Remark 4, the system \[(-1)^i(i-1)!(p-i)!\equiv1 \;(\mathrm{mod}\;p), \quad i=3, 4,\ldots, \frac{p-1}{2}\] cannot be perfect either. Hence in the consistent system of identities 15 , 16 and 17 the residues of \(\{2!, 3!,\ldots, (p-1)!\}\) modulo \(p\) cannot be distinct.

Declarations↩︎

Disclosure of interest↩︎

No conflict of interests was reported by the author.

Declaration of funding↩︎

No funding for this research was received.

Data availability statement↩︎

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

References↩︎

[1]
T. Trudgian, There are no socialist primes less than \(10^9\). Integers, 14(2014), #A63. , Zbl 1336.11009.
[2]
E. W. Weisstein, Wilson’s theorem. From MathWorld – A Wolfram Web Resource. Available from: https://mathworld.wolfram.com/WilsonsTheorem.html.
[3]
G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. Oxford University Press, New York, 2008. , Zbl 1159.11001.
[4]
R. Guy, Unsolved Problems in Number Theory. Third edition. Springer Science+Business Media, New York, 2004. , Zbl 1058.11001.
[5]
B. Rokowska and A. Schinzel, Sur une problème de M. Erdős. Elemente der Mathematik, 15(1960), 84–85. , Zbl 0089.26603.
[6]
E. W. Weisstein, Legendre Symbol. From MathWorld – A Wolfram Web Resource. Available from: https://mathworld.wolfram.com/LegendreSymbol.html.
[7]
V. Andrejić and M. Tatarević. On distinct residues of factorials. Publications de l’Institute Mathématique, NS, 100(2016), 101–106. DOI: 10.2298/PIM1614101A, , Zbl 1432.11016.
[8]
V. Andrejić and M. Tatarević. Searching for a counterexample to Kurepa’s conjecture. Mathematics in Computations, 85(2016), 3061–3068. DOI: 10.1090/mcom/3098, , Zbl 1360.11002.

  1. Former affiliation: School of Mathematics, Monash University, Australia↩︎

  2. Current status: aged pensioner↩︎

  3. Address: 24 Sagan Drive, Cranbourne North, Melbourne, Victoria-3977, Australia↩︎

  4. Email: vabramov126@gmail.com↩︎

  5. ORCID: 0000-0002-9859-100X↩︎