The Composite Two-Step

Eric Kaper Department of Mathematics University of Kentucky Lexington, KY 40506 USA

                  eric.kaper@uky.edu

Ryan Stuffelbeam Mathematics Program Transylvania University Lexington, KY 40508 USA

                rstuffelbeam@transy.edu

Abstract

Let a be a nonzero digit and b any of the digits 1, 3, 7, or 9. To a positive integer k, we alternately append a on the left and b on the right. This process yields two infinite sequences of integers, depending on which side the appending process begins. We are interested in those values of k that result in these sequences being composed entirely of composite integers. In particular, we seek the smallest such k relatively prime to the greatest common divisor of a and b.

1 Introduction

Jones [3] began an investigation of integers that produce only composite numbers when the same digit is repeatedly appended to the right. For each d ∈ {1, 3, 7, 9}, Jones found numbers coprime to d which generate composite sequences. Grantham, Jarnicki, Rickert, and Wagon [2] built on this by determining likely candidates for the smallest ‘seed’ in each of the 4 cases.

Jones and White [4] take things a ‘step’ or two further, pun intended. Given a list D of single digits and a positive integer k, an infinite sequence of positive integers is constructed by repeatedly appending the digits from the list D to k in one of four ways: alternating and starting on the left, alternating and starting on the right, always on the left, or always on the right. They extend methods previously employed by Jones [3] to discover positive integers k such that each term of the resulting sequence is composite. These methods do not necessarily depend on the values of the appending digits and are used to cover many cases at one time.

We specialize to the case where D contains two digits, a and b, and alternately concatenate, or append, a on the left and b on the right (or vice versa) to the positive integer k. We employ two different methods: a variant on the covering method utilized by Jones [3] and a new method that exploits symmetry in the construction of our sequences. Our objective is to minimize, for specific values of a and b the value of k that results in a composite sequence. We begin by setting our notation.

Given digits a and b, the positive integer k is a right seed if k is coprime to gcd(a, b) and if each number in the sequence

R(k, a, b) = (k, kb, akb, akbb, aakbb, aakbbb, aaakbbb, aaakbbbb, …)

is composite. We call R(k, a, b) the right two-step sequence with generator k and appending digits a and b. We let [a, b]_{R} denote the set of all right seeds for the appending digits a and b.

On the other side, for digits a and b, the positive integer k is a left seed if k is coprime to gcd(a, b) and if the sequence

L(k, a, b) = (k, ak, akb, aakb, aakbb, aaakbb, aaakbbb, aaaakbbb, …)

consists entirely of composites. We call L(k, a, b) the left two-step sequence with generator k and appending digits a and b. We let [a, b]_{L} denote the set of all left seeds for the appending digits a and b.

The subscript denotes the side on which the appending begins and we begin the indexing of a two-step sequence at 0, making the element s_{i} the value obtained after i appending operations. Also, we note the need to differentiate between left and right seeds. We will see that 5995 ∈ [1, 1]_{L} and 2200 ∈ [1, 1]_{R}. However, 59951 and 1122001 are both prime making [1, 1]_{L} and [1, 1]_{R} distinct sets with neither a subset of the other.

If b is even or 5, every number coprime to gcd(a, b) is a right seed in [a, b]_{R}. If b is even, all multiples of 5 are left seeds in [a, b]_{L}. Similarly, if b is 5, all even positive integers are left seeds in [a, b]_{L}. For these reasons, we restrict b to the set {1, 3, 7, 9}. Also, the coprime requirement of a seed eliminates obvious generators when the appending digits share a prime factor.

For a nonzero digit a and any b in {1, 3, 7, 9}, the obvious questions to consider are

1. Is [a, b]_{R} nonempty? If so, what is the smallest element of [a, b]_{R}?

2. Is [a, b]_{L} nonempty? If so, what is the smallest element of [a, b]_{L}?

2 Coverings, repunits, and the cover-12 method

Our first approach relies heavily on coverings of the integers. The concept of a covering goes back to Erdős [1].

Definition 1. A covering of ℤ is a system of congruences n ≡ c_{i} (mod m_{i}), 1 ≤ i ≤ t, such that every integer satisfies at least one of the congruences.

A simple nontrivial covering is n ≡ 0 (mod 2), n ≡ 1 (mod 2). The definition does not require a partition of the integers; some numbers may satisfy two or more congruences in a covering.

Given digits a and b and a generator k, we want a systematic way to determine if each element of a two-step sequence is composite. Coverings provide a way to do so. Roughly speaking, we associate a prime to each congruence in a given covering. Then, if the construction of the covering and the association of primes is viable, the nth value in the sequence will be divisible by the prime associated to the congruence satisfied by n. In this manner, the composite nature of each number in the two-step sequence is guaranteed. However, it remains to determine appropriate coverings and an association of primes in each case.

Jones and White [4] use this type of approach to show that the sets [a, b]_{R} and [a, b]_{L} are nonempty and, in fact, infinite. This settles the first issue in the questions posed above. However, their work focused on the existence of coverings and did not make use of the actual values of the digits a and b. Jones and White [4] use 31 distinct primes to construct universal coverings and, as a result, the seeds they find are extremely large. We develop a covering method that allows an association with no more than 7 primes to discover seeds with 10 digits or less and, in a majority of cases, these seeds are less than 150000.

Before discussing a detailed example, we motivate our approach in a general fashion for the right two-step sequence. Let a be any digit, b ∈ {1, 3, 7, 9} and k a generator. If one begins listing the base-ten expansions of elements in R(k, a, b), the appending of digits on both sides of k necessitates the fixing of a predetermined length for k, call this length l. Hence, for a given pair of appending digits a and b, many values of l may be considered before a seed is encountered.

Repunits, and their prime factors, play an important role in our next set of observations.

Definition 2. For m ≥ 1, the length-m repunit is

r_{m} = \frac{10^{m} − 1}{9} = \underbrace{11 … 11}_{m occurrences}

Given a base-ten expansion of a member of R(k, a, b), we may factor a and b from their appended portions, leaving repunits as factors on either side of the constructed number. For example, in R(k, a, b), s_{9} is 10^{5+l}a(1111) + 10^{5}k + b(11111). (We encourage the reader to similarly construct other elements of R(k, a, b) for future reference.) We use repunits with a significant number of distinct prime factors relative to their length to attach to coverings.

An ideal candidate is r_{6} due to its 5 distinct prime factors: 3, 7, 11, 13, and 37. We motivate our approach by considering the element s_{17} of R(k, a, b). The base-ten expansion of s_{17} is a·r_{8} ·10^{9+l} +10^{9}k +b·r_{9}. For a prime divisor p of r_{6}, s_{17} is congruent to a·r_{2} ·10^{3+l} + 10^{3}k + b · r_{3} modulo p and this last term is simply s_{5} in R(k, a, b). This is not a coincidence. Every 12 operations appends an additional copy of b · r_{6} to the right and a copy of a · r_{6} to the left. Also, a factor of 10^{6} appears on the base-ten summands involving both k and a. Since 10^{6} is congruent to 1 modulo p and r_{6} is divisible by p, this two-step sequence member is congruent modulo any prime divisor of r_{6} to the element 12 places before it in R(k, a, b).

This narrows our task to constructing a covering for the first 12 nonnegative integers, which we call a cover-12. Once a cover-12 is established and prime factors of r_{6} are associated to its congruences, any prime dividing s_{i} divides s_{12j+i} for any j. The construction of a cover-12 is predicated upon solutions to congruences modulo each of the prime factors of r_{6}.

To begin, we select appending digits a and b and a length l for the unknown generator k. We then list the first 12 elements of R(k, a, b) - s_{0}, s_{1}, …, s_{10}, s_{11} - and let p be a prime factor of r_{6}. For each i = 0, … 11, we determine the value of k making s_{i} divisible by p. We repeat this for each prime factor of r_{6}. We use Maple for these computations.

The result of these 60 calculations is a 12 × 5 table where each column corresponds to a prime divisor of r_{6} and a number in the ith row indicates the congruence class of the value of k that makes s_{i−1} divisible by the corresponding prime. The values in this table are used to determine if a cover-12 associated with 5, or fewer, primes is possible. For each viable cover-12, we apply the Chinese remainder theorem to the congruences involving k to find a solution modulo the involved primes. A solution is not enough; to be a seed, a solution must meet the designated length requirement.

3 A cover-12 example

Let’s attempt to find an element of [7, 1]_{R} of length 4. For each prime p = 3, 7, 11, 13, 37, we list the base-ten expansions of the first 12 elements of R(k, 7, 1), set each equal to 0 modulo p and solve the resulting congruences for k. This produces the following table where n is the number of appendings modulo 12:

\begin{matrix}n & p = 3 & p = 7 & p = 11 & p = 13 & p = 37 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 2 & 2 & 1 & 9 & 11 \\ 2 & 1 & 2 & 5 & 1 & 15 \\ 3 & 0 & 5 & 4 & 11 & 5 \\ 4 & 2 & 5 & 0 & 9 & 8 \\ 5 & 1 & 6 & 1 & 10 & 7 \\ 6 & 0 & 6 & 5 & 3 & 0 \\ 7 & 2 & 4 & 4 & 7 & 11 \\ 8 & 1 & 4 & 0 & 2 & 15 \\ 9 & 0 & 1 & 1 & 5 & 5 \\ 10 & 2 & 1 & 5 & 7 & 8 \\ 11 & 1 & 0 & 4 & 6 & 7 \end{matrix}

Table 1: R(k, 7, 1) congruence solutions

One cover-12, with associated congruences for k, is

n ≡ 0 (mod 3)  k ≡ 0 (mod 3)
n ≡ 7, 8 (mod 12)  k ≡ 4 (mod 7)
n ≡ 2 (mod 4)  k ≡ 5 (mod 11)
n ≡ 1, 4 (mod 12)  k ≡ 9 (mod 13)
n ≡ 5 (mod 6)  k ≡ 7 (mod 37).

Our use of the Chinese remainder theorem provides the solution k = 49032 which is unique modulo r_{6}. However, we are seeking a seed of length 4 and, consequently, 49032 is not viable. Another covering, with associated congruences for k, is given by

n ≡ 2  (mod 3)  k ≡ 1 (mod 3)
n ≡ 9, 10 (mod 12)  k ≡ 1 (mod 7)
n ≡ 3 (mod 4) k ≡ 4 (mod 11)
n ≡ 1, 4 (mod 12)  k ≡ 9 (mod 13)
n ≡ 0  (mod 6)  k ≡ 0 (mod 37)

Our application of the Chinese remainder theorem to this system yields k = 2479, a valid length-4 member of [7, 1]_{R}. Better yet, the covering explicitly details a prime factor of each element of R(2479, 7, 1): a repeating cycle through 37, 13, 3, 11, 13, 3, 37, 11, 3, 7, 7, and 3.

2479 is the smallest member of [7, 1]_{R} we found via the cover-12 method; for smaller lengths either no cover was found or the solution did not satisfy the fixed length requirement.

The necessity to account for the length of the generator is an extra impediment inherent to this method.

Though this method uses many fewer prime factors than the approach of Jones and White [4], it comes with a cost. Our cover-12 method uses the values of the appending digits to create a table of congruences involving k. Using the table to find a cover-12, applying the Chinese remainder theorem to the resulting system and validating the length of the seed involves a bit of work. Moreover, one must scrutinize the table to find every possible cover-12. On top of all this, this entire process is undertaken for varying lengths of k, until an element of [a, b]_{R} is located. The upside is the discovery of small seeds.

We used the cover-12 method to find right seeds in 28 of the 36 sets [a, b]_{R} under consideration and these values are listed in Table 2. The exceptions are [6, 3]_{R}, [9, 3]_{R}, [6, 7]_{R}, [7, 7]_{R}, [9, 7]_{R}, [3, 9]_{R}, [6, 9]_{R}, and [7, 9]_{R}.

4 Coverings with more congruences

A cover-12 eluded us in each of the 8 noted exceptions. For the exceptional cases with gcd(a, b) > 1, this is not surprising; the appending digits share a prime factor with r_{6}, removing a prime from consideration in the cover-12 method. In light of this, we seek a repunit with more than 5 prime factors. With 7 distinct prime factors - 3, 7, 11, 13, 37, 101, and 9901 - r_{12} is the logical choice.

We can naturally adjust the above arguments and calculations in the cover-12 method to use r_{12} and a cover-24. The resulting table of congruences for the generator has 24 rows and 7 columns. The rows correspond to the two-step sequence elements s_{0}, s_{1}, …, s_{22}, s_{23} while the columns correspond to the prime factors of r_{12}. We must inspect the table for each and every possible cover-24 and, once a cover-24 is located, apply the Chinese remainder theorem to find a possible seed, subject to the designated length requirement.

The cover-24 approach succeeds in finding seeds of length 10 in [6, 7]_{R}, [7, 7]_{R}, [9, 7]_{R}, and [7, 9]_{R}. These right seeds along with the right seeds determined via the original cover-12 method are listed below.

We note that each seed is composite as required. We also note that the Chinese remainder theorem provides a solution modulo r_{6} = 111111. When l = 6, a cover-12 for R(k, 6, 1) produced a solution of 31482. Adding r_{6} to this value gives a valid length-6 seed 142593. A similar scenario plays out in the discovery of 113938 in [2, 3]_{R}.

5 Starting on the left

We turn our focus to small seeds in [a, b]_{L}. The cover-12 method is easily adjusted to suit the left two-step sequence L(k, a, b). The primary change is in the form of the congruences

Case Seed Case Seed  Case Seed
[1, 1]_{R} 2200 [4, 3]_{R} 54615  [7, 7]_{R} 1134835262
[2, 1]_{R} 938 [5, 3]_{R} 92595 [8, 7]_{R} 638
[3, 1]_{R} 2076 [6, 3]_{R} ?  [9, 7]_{R} 1490744143
[4, 1]_{R} 11895 [7, 3]_{R} 25970  [1, 9]_{R} 21053
[5, 1]_{R} 159 [8, 3]_{R} 8066 [2, 9]_{R} 4266
[6, 1]_{R} 142593 [9, 3]_{R} ?  [3, 9]_{R} ?
[7, 1]_{R} 2479 [1, 7]_{R} 6409  [4, 9]_{R} 12509
[8, 1]_{R} 1290 [2, 7]_{R} 447  [5, 9]_{R} 109857
[9, 1]_{R} 10571 [3, 7]_{R} 23162  [6, 9]_{R} ?
[1, 3]_{R} 2368 [4, 7]_{R} 84  [7, 9]_{R} 6287118099
[2, 3]_{R} 113938 [5, 7]_{R} 258  [8, 9]_{R} 32472
[3, 3]_{R} 10948 [6, 7]_{R} 1316005328 [9, 9]_{R} 14344

Table 2: Small Right Seeds

involving k and this stems directly from beginning the appending process on the left instead of the right. That said, the process is entirely analogous to the cover-12 method for right two-step sequences.

We employ this adjusted cover-12 method to produce left seeds of length 6 or less in 28 cases, the same 28 as in the search for right seeds. Our inability to find a cover-12 for any of the 8 outliers [6, 3]_{L}, [9, 3]_{L}, [6, 7]_{L}, [7, 7]_{L}, [9, 7]_{L}, [3, 9]_{L}, [6, 9]_{L}, and [7, 9]_{L} is not unexpected.

Based on our prior work, the next logical step is to use the 7 prime factors of r_{12} and a cover-24 approach to tackle the exceptional cases. As in the right two-step scenario, our application of the cover-24 process succeeds in finding 10-digit left seeds in [6, 7]_{L},[7, 7]_{L}, [9, 7]_{L}, and [7, 9]_{L}. We have the following results for left two-step sequences.

Each seed is indeed composite and, in the case of [5, 3]_{L}, r_{6} was added to create a seed of the required length. Since L(2902678537, 7, 7) consists entirely of composite values, so does R(290267853, 7, 7). 290267853 is smaller than the right seed in [7, 7]_{R} produced by the cover-24 method and we have a new small seed in [7, 7]_{R}.

The right and left seeds listed are the smallest we found using the cover-12 and cover-24 methods. As noted by Grantham et al. [2] when appending only a single digit on the right, it is difficult to explicitly demonstrate that a given seed is the smallest. The computational power needed in trying to show a number is not a seed is tremendous and tenuous due to the probabilistic nature of many prime-checking programs. However, the seeds 37, 4070, 891, and 10175 for the digits d = 1, 3, 7, and 9 were deemed likeliest to claim the title of ‘the smallest’ [2]. Our seeds are similar in magnitude and we believe they provide a worthwhile starting point in the search for the ‘smallest’ right and left seeds.

Case Seed Case Seed  Case Seed
[1, 1]_{L} 5995 [4, 3]_{L} 22906  [7, 7]_{L} 2902678537
[2, 1]_{L} 1959 [5, 3]_{L} 148176  [8, 7]_{L} 3270
[3, 1]_{L} 16654 [6, 3]_{L} ?  [9, 7]_{L} 1600156945
[4, 1]_{L} 7294 [7, 3]_{L} 9845  [1, 9]_{L} 26466
[5, 1]_{L} 687 [8, 3]_{L} 8066  [2, 9]_{L} 4266
[6, 1]_{L} 98148 [9, 3]_{L} ?  [3, 9]_{L} ?
[7, 1]_{L} 24791 [1, 7]_{L} 22920  [4, 9]_{L} 103411
[8, 1]_{L} 6513 [2, 7]_{L} 1666  [5, 9]_{L} 24220
[9, 1]_{L} 22373 [3, 7]_{L} 1265  [6, 9]_{L} ?
[1, 3]_{L} 23683 [4, 7]_{L} 84  [7, 9]_{L} 1967190095
[2, 3]_{L} 25049 [5, 7]_{L} 1738  [8, 9]_{L} 102507
[3, 3]_{L} 10948 [6, 7]_{L} 4461572896 [9, 9]_{L} 3080

Table 3: Small left seeds

6 The factorization method

When a = 6, 9, b = 3 or a = 3, 6, b = 9, we were unable to find right or left seeds using our covering method. This led us to consider another approach, one we call the factorization method. Though we are unable to use this new method to find seeds in these exceptional cases, we do experience success in applying it to produce very small seeds in other instances.

We note that the even-indexed terms are the same in R(k, a, b) and L(k, a, b). Such a value has base-ten expansion

a · r_{m}10^{m+l} + k10^{m} + b · r_{m} = a (\frac{10^{m} − 1}{9}) 10^{m+l} + k10^{m} + b (\frac{10^{m} − 1}{9})

where 2m is the index and l is the fixed length of the generator k. The question motivating our new approach is: Can we factor the even-indexed terms of a two-step sequence?

We multiply the final expression above by 9 and, since the index varies, we replace 10^{m} by the variable x. This allows us to rewrite the expression as

a · 10^{l} · x^{2} + [9 · k + b − a · 10^{l}]x − b.

We suppose this quadratic factors into a product of linear terms (Ax + B)(Cx + D) for unknown integer values A, B, C, and D. For this to occur, we must have

AC = a · 10^{l}  (1)
BD = −b  (2)
AD + BC = 9 · k + b − a · 10^{l}  (3)

From (3), we have

k = \frac{1}{9}(AD + BC + a · 10^{l} − b).

Suppose we find integral values of A, B, C, and D satisfying the above equations for appending digits a and b. Due to (1) and (2), none of these values are zero. Hence, for m ≥ 1, each of the terms Ax + B and Cx + D are greater than 1 and this forces the corresponding even-indexed terms to be composite. For m = 0, we must explicitly check whether the generator k is composite.

As indicated by equations (1) and (2), for each pair of factors of a · 10^{l} and each pair of factors of b, we compute k as expressed above and check if it is integral and composite of the correct length l. We wrote Maple programs to perform these checks. For the resulting k to be a seed, we must examine the relevant odd-indexed terms.

We consider the example of L(k, 7, 1) to highlight the approach to the odd-indexed terms. Going through the above process with l set to 1 results in a value of k = 8; each of the evenindexed terms of L(8, 7, 1) are composite. The odd-indexed terms of L(8, 7, 1) are the same as the even-indexed terms of R(78, 7, 1). We apply the factorization method to the evenindexed terms of R(k, 7, 1) with l = 2 in hopes that 78 is an output. It turns out that it is. Thus, all of the elements of L(8, 7, 1) are composite and 8 ∈ [7, 1]_{L}.

Better yet, since the nth term of R(78, 7, 1) is the (n + 1)st term of L(8, 7, 1), R(78, 7, 1) consists entirely of composite values and 78 is smaller than the seed 2479 discovered by the cover-12 method. Thus, the factorization method has indirectly yielded another new small seed.

In 14 cases, the factorization method directly produces seeds smaller than those discovered by our covering methods. In 11 of these cases, an appropriate consideration of the opposite-stepped sequence (as above with R(78, 7, 1)) reveals a seed smaller than the one constructed by our covering methods. The one-seed-only situations are [5, 7]_{R}, [5, 7]_{L}, and [8, 9]_{L}.

Case Seed Case Seed Case Seed
[2, 1]_{R} 221 [5, 7]_{R} 62 [2, 3]_{L} 198
[4, 1]_{R} 441 [6, 7]_{R} 667 [4, 3]_{L} 473
[5, 1]_{R} 56 [8, 7]_{R} 95 [1, 7]_{L} 11077
[7, 1]_{R} 78 [2, 1]_{L} 21 [2, 7]_{L} 187
[8, 1]_{R} 9  [4, 1]_{L} 4411 [5, 7]_{L} 72
[2, 3]_{R} 2198 [5, 1]_{L} 6  [6, 7]_{L} 6677
[4, 3]_{R} 4473 [7, 1]_{L} 8  [8, 7]_{L} 957
[1, 7]_{R} 1107 [8, 1]_{L} 91 [8, 9]_{L} 8099
[2, 7]_{R} 18

Table 4: Smaller seeds produced by factorization method

One can check that the four seeds less than 20 we found using the factorization method are the smallest in their respective sets. For the other cases, many potential small generators can be quickly eliminated. The factorization method produced 78 as a small seed in [7, 1]_{R}. We wrote a Maple program to alternately append 1 on the right and 7 on the left to a given positive integer k. We used Maple’s primality check to determine the composite nature of the first four hundred terms of the resulting sequence. Of the fifty-six composite numbers less than 78 available to serve as a seed, fifty-four produced a sequence with a prime number somewhere in the first ten spots. The generator 34 took nineteen concatenations to produce a prime number. The generator 39 is the only obstacle to declaring 78 the smallest seed in [7, 1]_{R}. The first member of the sequence R(39, 7, 1) to be flagged as prime by Maple is s_{361}. The probabilistic nature of Maple’s primality test coupled with the length of this number, 363 digits, preclude us from definitively excluding 39 from [7, 1]_{R}.

7 The next step

Our methods have discovered small seeds in 64 of the 72 cases. The results and omissions leave us with a number of questions.

1. The smallest seed is known in [8, 1]_{R}, [2, 7]_{R}, [5, 1]_{L}, and [7, 1]_{L}. In the other 58 successful cases, are the known seeds the smallest seeds? If not, how does one produce the smallest seeds?

On a related note, the smallest seeds in [6, 7]_{R} and [6, 7]_{L} discovered using the cover-24 method were 10 digits long. The factorization method produced much smaller seeds in both cases. This leads us to believe in the cases where a = 7, 9, b = 7 or a = 7, b = 9 there are seeds with fewer than 10 digits. Is this so?

2. We did not exhibit any small right or left seeds when a = 6, 3, b = 3 or a = 3, 6, b = 9. Jones and White [4] produced seeds using 31 distinct primes. Can one find a method to produce a smaller seed in these exceptional cases?

3. In 4 cases, a = b = 3; a = 8, b = 3; a = 4, b = 7; and a = 2, b = 9, the cover-12 method produces the same ‘smallest’ right and left seeds. Are these coincidences or a feature of the involved appending digits?

References

[1] P. Erdős, On integers of the form 2^{k} +p and some related problems, Summa Brasil. Math. 2 (1950) 113–123.

[2] J. Grantham, W. Jarnicki, J. Rickert, and S. Wagon, Repeatedly appending any digit to generate composite numbers, Amer. Math. Monthly 121 (2014) 416–421.

[3] L. Jones, When does appending the same digit repeatedly on the right of a positive integer generate a sequence of composite integers? Amer. Math. Monthly 118 (2011) 153–160.

[4] L. Jones and D. White, Appending digits to generate an infinite sequence of composite numbers, J. Integer Sequences 14 (2011), Article 11.5.7.

2010 Mathematics Subject Classification: Primary 11B99; Secondary 11A51, 11A07. Keywords: composite number, covering.

Received March 2 2017; revised versions received September 4 2017; September 6 2017. Published in Journal of Integer Sequences, September 7 2017.

Return to Journal of Integer Sequences home page.