Abstract
Previous work established the set of square-free integers n with at least one factorization for which and are valid RSA keys, whether they are prime or composite. These integers are exactly those with the property , where is the Carmichael totient function. We refer to these integers as idempotent, because for any positive integer k. This set was initially known to contain only the semiprimes, and later expanded to include some of the Carmichael numbers. Recent work by the author gave the explicit formulation for the set, showing that the set includes numbers that are neither semiprimes nor Carmichael numbers. Numbers in this last category had not been previously analyzed in the literature. While only the semiprimes have useful cryptographic properties, idempotent integers are deserving of study in their own right as they lie at the border of hard problems in number theory and computer science. Some idempotent integers, the maximally idempotent integers, have the property that all their factorizations are idempotent. We discuss their structure here, heuristics to assist in finding them, and algorithms from graph theory that can be used to construct examples of arbitrary size.
1. Introduction
Take two integers and , let . Let . Find two integers d and e such that . Publish e, keep d secret. Let M be a message, let its encrypted version be given by by . Let the decryption operation be given by . What are the conditions on and such that ?
Readers will recognize this as the RSA protocol [1], with the required conditions constraining encryption and decryption to “work”: Encrypting and decrypting in this manner will recover the original message. Ref. [1] showed that choosing and as prime numbers will not only meet this required condition, but also provides the valuable property of making n empirically difficult to factor (when and are sufficiently large). This in turn leads to the security of RSA.
While choosing n as a semiprime provides the necessary security properties, and reduces to Euler’s totient function, semiprimes are not the only integers for which the correctness of this protocol is preserved. Ten years after [1,2] implicitly showed, without explicitly stating, that the set of these integers also includes some of the Carmichael numbers. Whether there were other possible values of that were neither semiprimes nor Carmichael numbers remained unknown.
In [3], we introduced the notion of idempotent integers, the set of square-free integers n that can be factored into two positive integers and such that , where is the Carmichael totient function. We refer to these integers as idempotent because for any positive integer k. These integers are exactly those for which and generate valid keys in the 2-prime RSA protocol, regardless of whether they are prime or composite [3].
While only the semiprimes have useful cryptographic properties [4], idempotent integers are deserving of study in their own right, as they lie at the border of hard problems in number theory and computer science. Some idempotent integers, the maximally idempotent integers, have the property that all their factorizations are idempotent. We discuss their structure here, heuristics to assist in finding them, and algorithms from graph theory that can be used to construct examples of arbitrary size. We discuss what is currently known, present new results since [3], and discuss open problems.
2. Materials and Methods
2.1. Definitions
Let be a square-free integer, where are primes. Let . We will call the predecessor of and the successor of . It is a known property of the function that , where lcm denotes the least common multiple. We will write instead of when the meaning is clear. We write as shorthand for .
Let . Let P be the set . Sets A and B are said to partition P if (a) either or , (b) , and (c) . A factorization of n into is any such that where A and B partition P. An idempotent factorization is a factorization for which . We will refer to an integer n that has an idempotent factorization as idempotent when the meaning is clear.
Let be prime, consider a semiprime . It is a known property of that . Since , all semiprimes are trivially idempotent. We do not consider them further here.
Any square-free integer with m factors has factorizations of the form factorizations of the form , and so forth. Each factorization corresponds to a single equation in and that represents a possible idempotent factorization. We refer to these as single-factor equations/factorizations, double-factor, etc. We call idempotent single-factor factorizations semi-composite factorizations of n, because is prime while is composite. All other factorizations are fully composite.
The first eight square-free n with three or more factors and fully composite idempotent factorizations are shown in Table 1 [3].
Table 1.
The first 8 integers with fully composite idempotent factorizations.
The smallest integer with two fully composite idempotent factorizations is 2730, when factored into 10*273 and 21*130. The complete list of all with fully composite idempotent factorizations is available at [5].
2.2. Maximally Idempotent Integers
An integer is maximally idempotent if all its factorizations are idempotent. These integers have the property that all their factorizations produce correctly functioning RSA keys.
The first 16 maximally idempotent n with 3 and 4 prime factors are shown in Table 2, along with the two 5-factor cases < [3]. Carmichael numbers are underlined.
Table 2.
Maximally idempotent integers with 3, 4 and 5 factors.
Maximally idempotent integers are rare. Below there are 15,189 with three prime factors, 315 with 4, and 2 with 5.
The smallest and smallest known maximally idempotent integers with m factors for are shown below in Table 3:
Table 3.
Smallest or smallest known (m = 8, 9) maximally idempotent integers with m factors.
3. Results
3.1. Some Structural Properties of Maximally Idempotent Integers
A number of quantities affect whether or not an integer is maximally idempotent: The smallest prime , the largest prime , the number of factors m, the GCD of each distinct set of factorizations, and the least common multiple of the .
We begin with a universal property of maximally idempotent integers:
Theorem 1.
All maximally idempotent integers with at least three factors are odd.
Proof.
First, we consider the case . There are three equations that must be satisfied for n to be maximally idempotent:
Assume . Plugging it into the above, we obtain:
Applying the first equation to the second and third, we have:
For distinct with , so the above is impossible.
Now, let be a maximally idempotent integer with . There are m single-factor equations that n satisfies:
Assume and substitute. We have
Multiplying out the second equation and substituting the first, we have
Now, consider the double factor equations resulting from moving from the right side of a single-factor equation for . Since n is maximally idempotent, it satisfies these equations as well. We have:
By setting all these equations equal to each other mod and working through the algebra, we find the mutual equivalences from the single and double factor equations imply . For as defined previously with distinct , this is impossible. □
The above is an example of a restriction on as a result of increasing m (since for , the result does not hold). A similar result can be obtained showing that , omitted here due to space limitations. We offer the following:
Conjecture 1.
If is the smallest prime factor of an m-factor maximally idempotent integer, and is the smallest prime factor of an -factor maximally idempotent integer, then .
This is consistent with all empirical results so far. Below Table 4 are the smallest , for which maximally idempotent integers are known for .
Table 4.
Smallest for given m for which maximally idempotent integers are known.
It is unknown if maximally idempotent integers exist for (, ), (, ) or (, ). We propose these and the conjecture above as open problems, waiting for proofs of nonexistence or counterexamples.
3.2. A Structure Theorem for Maximally Idempotent Integers
Let be an m-factor maximally idempotent integer, . Let (note we are deliberately omitting ). Let . Consider the first two single-factor equations, where the first term is , under modulo . (The equation with a left factor of is trivially true mod , so we consider the equations with left factors of and ). We obtain
(Recall that ). Next, consider the factorization equation . By the requirements of maximal idempotency, we have
Multiplying this equation by N and then subtracting the previous result, we get
Applying this to the other mod equations, and then to the other moduli , we obtain
Letting , it is easily shown that for distinct , we must have , and that a set of distinct positive is a solution . So any maximally idempotent integer has the property .
Since , there are a finite number of m-factor maximally idempotent integers with a given and .
The results above are expressed in terms of . We noted previously that for the resulting system of modular equations, . In fact, we may fix any factor, not just . This gives a Ratio Theorem for Maximally Idempotent Integers:
Theorem 2.
Let n be a maximally idempotent integer with factors . For any .
The Ratio Theorem means that all but one of the prime factors of maximally idempotent integers are constrained to be within a certain range of one another; there can be at most one outlier. For example, the primes [7, 11, 127, 211, 853] could not form a maximally idempotent integer, because . However, the primes [7, 727, 1453, 2179, 4357] can and do form a maximally idempotent integer. Note for this integer , all of which divide . Note as well that the Ratio Theorem holds.
The Ratio Theorem also has computational implications. It means fixing any two prime factors permits the enumeration of all maximally impotent integers containing those factors.
We have not yet considered the equations corresponding to the factorization , for moduli :
These also form a set of modular equations similar to the one considered above. This time the constant C is , which here implies that for any solution we must have .
We sum up the results of this section as a Structure Theorem for Maximally Idempotent Integers:
Theorem 3.
Let be a maximally idempotent integer with m factors, prime. Let . n must satisfy the following conditions:
(1)
(2)
We emphasize that these are necessary conditions, but not sufficient. [5, 7, 13, 19] satisfies both criteria, but does not form a maximally idempotent integer.
The smallest possible value of is . Thus, for small , condition 2 will most likely be met when is at or close to . For example, the four smallest maximally idempotent integers with and are 137,555 = 5*11*41*61, 356,595 = 5*19*37*73, 5,521,745 = 5*29*113*337, and 23,988,515 = 5*59*233*349. In these cases, is either or . For and , the smallest maximally idempotent integer is 146,168,311,505 = 5*101*401*601*1201, with at the minimum value . Similarly, for the previously considered maximally idempotent example 70,200,928,349,251 = 7*727*1453*2179*4357, also has minimum value of . Note that both these examples meet Condition 1. We will have more to say about the value of in the sections that follow.
Condition 1 imposes a crude lower limit on as a function of m, in that must contain at least divisors. These limits for small m are shown in the Table 5 below:
Table 5.
These limits for small m are shown.
In some cases, tighter bounds have already been established by the work previously shown. Cases where gaps remain are offered as open problems.
3.3. The Role of Factorization Equation GCD’s
Let denote the gcd of all factorization equations of n with i factors on the left side. For example, with = 43*79*223*331, we have
We will omit the argument n if the meaning is clear. It is easily seen that n is maximally idempotent if for all i for which i-factor factorizations exist.
Empirically, and are almost always equal, with the probability rapidly approaching 1 as m increases, becomes smaller. Below Table 6 shows data for , based on a million random permutations of length m from the first 100,000 primes.
Table 6.
Data for , based on a million random permutations of length m from the first 100,000 primes.
The fact that so often has implications for improving the efficiency of search algorithms for maximally idempotent integers.
3.4. Finding Maximally Idempotent Integers
The equations of idempotency have some redundancy. In particular, let and be a factorization of n. Because , any may be moved from to without affecting the product mod . Thus, in addition to the explicit equivalence equation of a given factorization, there are implied equivalences mod . If equations are chosen such that a given equivalence is implied for all , then it holds for even if it is not explicitly given (recall that ).
This has implications when testing for maximal idempotency. For example, only the single factor equations need to be tested for , as they imply the three double factor ones. For , only 12 of the possible 15 equations need be tested, and so forth.
However, based on the results regarding and above, it is empirically more efficient to check the single factor equations first. If any one of them fail, n is not maximally idempotent. If they all pass, then the double factorizations can be checked, and so forth. It is also more efficient to compute one equation at a time. If the current value ever drops below , further testing is not required since can never divide it.
One way to find maximally idempotent integers is to simply iterate through a range of integers n, factor them, calculate for the ones that are square free, and then see if the equations for maximal idempotency are satisfied. As this requires factoring, this is computationally intensive. A more productive approach is to start with the primes in a given range and test products for etc. In particular, we may fix and and then identify all the maximally idempotent integers with factors inclusively between those two values.
Based on the results previously discussed, we may expect maximally idempotent integers to be found only when is at a local minimum ( or a small multiple thereof) and the ’s are at a local maximum. This confirmed in the figures below, which show and as a function of n. Logarithmic values are used due to the differences in magnitude between and .
Figure 1 shows this plot for . The orange data set is the log of , the gray is the log of . Each data point is for a value of , sorted in increasing order. The values of n where are marked with vertical lines. The value of that ratio is read from the right vertical axis. Red lines correspond to those cases where is an integer, and indicate all the maximally idempotent integers in this range.
Figure 1.
.
Figure 2 shows these lines alone, along with their data values. The left value in each label with a reciprocal integer ratio (indicated with a red line) is a maximally idempotent integer.
Figure 2.
.
Figure 3 and Figure 4 show similar plots with . Increasing the number of factors to 4 increases the number of data points, but it also increases as it starts to pull away from . (Recall that logarithmic scales are used, making the absolute difference exponentially larger than that depicted in the figure). The overall effect is to decrease the number of integers with . We note, however, that the proportion of those integers which are maximally idempotent increases. We conjecture this ratio approaches 1 with increasing m.
Figure 3.
.
Figure 4.
.
Figure 5 increases from 7 to 11. Increasing increases the average slightly, but significantly increases . It also reduces the number of candidates that can satisfy the Ratio Theorem. The overall effect is a net decrease in the number of integers with , and therefore the number of maximally idempotent integers. No maximally idempotent integers exist in this range with .
Figure 5.
.
Figure 6 increases from 97 to 199. Doubling increases the number of candidates in the combinatorially expected manner, which increases the probability of an maximally idempotent integer being found. On the other hand, their asymptotic density decreases. We conjecture the asymptotic density of maximally idempotent integers for a given approaches zero. It is unknown if for a given for which an maximally idempotent integer exists, there is a maximum beyond which no more maximally idempotent integers can be found, or if there are infinitely many.
Figure 6.
.
Figure 7 further increases m to 6, showing the smallest 6-factor maximally idempotent integer in the given range (indicated with a red circle). This is the entry for in Table 2. The black rectangle appears to indicate a second example, but that is an artifact of scale, due to both the large number of points on the x axis (approximately 750 million) and the logarithmic scales employed on the y axis. While in both of the indicated areas there are values at the maximum of 600, with , the minimum in the rectangle is 760, . The apparent match in the rectangle is in fact a local minimum between two local maximum . Figure 8 makes this clearer.
Figure 7.
.
Figure 8.
Detail from .
Thus, there is only one maximally idempotent integer with in the indicated range, the smallest one with 6-factors. There are none with . We conjecture there are no other maximally idempotent integers with for .
3.5. Constructive Techniques
3.5.1. Improving the Odds with Divisor Sequences
More than half of the entries in Table 2 are primes in arithmetic progression, where each factor is of the form . As m increases, more and more maximally idempotent integers take this form. This is because sequences of increasing where all divide iff , the minimum possible value. This is more likely to occur with primes in arithmetic progression. This not a sufficient condition, due to the influence of the , nor is it necessary, since may still be a local minimum if all the divide a small multiple of . Nonetheless, as a heuristic it is useful for finding maximally idempotent integers faster than brute force or searching arbitrary combinations of m primes.
To find an maximally idempotent integer with m factors, we begin with a desired and a number N that contains at least m divisors , with prime. Next, we identify those such that is prime, discarding the rest. The resulting subsets will have such that will be at its smallest possible value . These subsets can then be tested for maximal idempotency. We refer to these subsets as divisor sequences, since all of them are divisors of .
For example, suppose we are searching for 6-factor maximally idempotent integers with . 300 has 8 divisors, but 301 is not prime. Additionally, 40 has 8 divisors and 401 is prime, but only four of them have the property that is prime. Additionally, 60 has 12 divisors, of which 7 have prime, giving the divisor sequence {}. (Note that all divide the largest value of 600). There are seven possible subsets of size 6 to test, one of which produces the maximally idempotent integer 11*31*41*101*151*601. Note that this not the smallest 6-factor example, which has the corresponding divisor set {}. These are not all divisors of 150, so this is a case of an maximally idempotent integer where is not equal to .
The complete subset of all seven primes above is also maximally imdepotent; it is the smallest seven-factor example. All maximally idempotent integers known to the author with seven or more factors have either been found using this technique, or explicitly constructed using a technique from graph theory. We discuss that next.
3.5.2. Constructing Large Maximally Idempotent Integers Using k-Cliques in Congruence Graphs
Random primes in modern cryptography are hundreds of bits long, found efficiently using probabilistic algorithms [6]. Do similarly large maximally idempotent integers exist, and if so, can they be found? The answer is yes, and probabalistic techniques are not required. They can be constructed explicitly, of any size desired.
It is not difficult to show that every equation for idempotency is a linear sum of products of , where each term is of length . For maximal idempotency, all such sums must be . Any set of for which all distinct products will have this property, and will therefore correspond to a maximally idempotent integer. This is not a necessary condition, but it is sufficient.
Such sets of can be constructed in the following way. (1) Choose a highly composite number. (2) Make nodes in a graph corresponding to all divisors of such that the successor of is prime. (3) Connect all node pairs such that . We call the resulting graph a congruence graph.
For any congruence graph, of any subset of its nodes is their lcm, which in turn must divide . For all pairs of nodes in a k-clique, is congruent to 0 mod . Therefore all are congruent to zero mod the lcm of any subset of divisors of , including the members of the clique themselves.
Thus, every , where is the lcm of every node in the clique. This means that every k-clique corresponds to a maximally idempotent integer with k factors. Similarly, any divisor of a maximally idempotent integer constructed in this way is also maximally idempotent. Thus, a k-clique in a congruence graph contains maximally idempotent integers with factors, for a total of (we ignore the primes and semiprimes).
For example, consider . The resulting divisors with prime are . This produces the congruence graph of Figure 9.
Figure 9.
Congruence graph for .
This graph contains six 3-cliques and one 4-clique. These correspond to seven maximally idempotent integers with . Five of the six 3-cliques correspond to integers in Table 2. The 4-clique is the smallest maximally idempotent integer with four factors, also shown in Table 2.
In general, to construct a maximally idempotent integer with a large number of factors, choose highly composite. The divisor graph will then have a large number of nodes, high connectivity and a greater likelihood of k-cliques for larger k.
Table 7 shows the values of when the first cliques of size k appear using this method, along with some information about the graph and the size of the largest maximally idempotent integer it contains.
Table 7.
Smallest where k-cliques first appear in congruence graph.
Figure 10.
Congruence graph for = 44,100.
The largest k-clique currently constructed by the author has 141 nodes, corresponding to an maximally idempotent integer of 2081 digits. It contains approximately maximally idempotent integers as divisors.
Idempotent factorizations can also be constructed from a congruence graph. It can be shown that any complete bipartite subgraph of the congruence subgraph corresponds to an idempotent factorization of an integer n with j and k factors, respectively, where n is the product of the successors of the corresponding ’s. For example, Figure 9 has a complete bipartite subgraph on and , shown in Figure 11. This corresponds to the idempotent factorization . n = is not maximally idempotent, but it does have the indicated fully composite idempotent factorization. Complete subgraphs of congruence graphs correspond to maximally idempotent integers, while complete bipartite graphs correspond to idempotent integers. Again, we emphasize these are sufficient conditions, not necessary ones.
Figure 11.
Complete bipartite subgraph on (4, 6) and (18, 36).
4. Discussion, Conclusions, and Directions for Future Work
We define the class of idempotent integers as those n which can be factored into such that . This set includes the primes, semiprimes, and Carmichael numbers, but is not unique to them. Maximally idempotent integers are those for which all factorizations are idempotent. This last category presents interesting open problems. For maximally idempotent integers as defined above, for a given and a given m is the number of maximally idempotent integers infinite? Of those n for which , does the proportion for which approach 1 as n increases? What lower bounds on can be proven as a function of m?
Rather than regard idempotency as a discrete property of factorizations and integers, idempotency could be viewed on a continuum. Factorizations of n that are not fully idempotent may be viewed as partially idempotent, depending on the pair chosen according to the RSA protocol [7]. In this case, the k in the definition of idempotency is replaced by . Some integers may then be regarded as minimally idempotent, meaning that no pairs for any factorization are idempotent. The values for minimally idempotent integers are solutions to a system of nonlinear modular equations, a known NP-complete problem. The statistical properties of partial idempotency and heuristics for finding minimal idempotency are a work in progress.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
See the author’s published sequences in The On-Line Encyclopedia of Integer Sequences, http://oeis.org (accessed on 28 July 2021).
Conflicts of Interest
The authors declare no conflict of interest.
References
- Rivest, R.; Shamir, A.; Adleman, L. A Method for Obtaining Digital Signatures and Public-Key Cryptosystem. Commun. ACM 1978, 21, 120–126. [Google Scholar] [CrossRef]
- Dennis Huthnance, E.; Warndof, J. On Using Primes for Public Key Encryption Systems. Appl. Math Lett. 1988, 1, 225–227. [Google Scholar] [CrossRef][Green Version]
- Fagin, B. Idempotent Factorizations of Square-Free Integers. Information 2019, 10, 232. [Google Scholar] [CrossRef]
- Pinch, R. On Using Carmichael Numbers for Public Key Encryption Systems. In Proceedings of the International Conference on Cryptography and Coding, Cirencester, UK, 17–19 December 1997; pp. 265–269. [Google Scholar]
- Fagin, B.; OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences. Squarefree n with Fully Composite Idempotent Factorizations. 2018. Available online: http://oeis.org/A306508 (accessed on 28 July 2021).
- Rabin, M. Probabalistic Algorithm for Testing Primality. J. Number Theory 1980, 12, 128–138. [Google Scholar] [CrossRef]
- Fagin, B. Idempotent Factorizations in the Classroom. Coll. Math. J. 2020, 51, 195–203. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).