Problems & Puzzles: Collection 20th

Coll.20th-011. One more as 43*47=2021

On April 6, 2018, Giovanni Resta wrote:

One may notice that the product of the two consecutive
primes 43 and 47 is equal to the concatenation of 2 consecutive integers:

43 * 47 = 2021

Q1 Find another pair of consecutive primes whose product is the
concatenation of two consecutive integers in ascending order.

Similarly, find a pair of consecutive primes whose product is a concatenation of two consecutive integers in descending order.


Jan van Delden wrote on Sep 12, 2018:

No solution I’m afraid, but a few remarks.


In Sloane encyclopedia integer sequences can be found relating to questions of the following two relating questions:


  1. Numbers n such that n concatenated with n+a gives the product of two numbers which differ by b.
  2. Numbers n such that n concatenated with n+a is a square. (or b=0).


We are looking for solutions of the first type where a equals +/-1, b is even and n, n+/-b are prime.


Several of our puzzler’s, but mainly Patrick de Geest and Giovanni Resta, have contributed these sequences.

Integer sequences A030465 and A054214 solve type b. for a=1 and a=-1 respectively.


Trying to solve Q2 for twin primes p,q:


p.q = n(10^d+1) – 1 gives:

m^2=n(10^d+1)  (using p=m-1,q=m+1)


So a solution to type b. with even m and m+/-1 prime would be nice.

Checking the even solutions of A102567 will not give our sought solutions.


I studied solutions to pq=n(10^d+1)+r with |r|>0  and |r| as close to 1 as possible.


My best solution is (r=-4):




Maybe Giovanni could share some of his thoughts on the matter?



All I [CR] can say at this moment is that Giovanni Resta positively sent one solution for each question. Let's see if he wants to share some other thoughts on the matter.



On April 6, 2019, Ken Wilke wrote:


I have obtained a “potential solution” not previously mentioned on your website. I say potential because initial zeroes are involved (and are not specifically excluded by the statement of the problem.


The potential solution is 4999493*4999507= 0024995000249951.



Let pi and pi+1 be consecutive primes where pi+1 – pi = 2d for some integer d. Then the product pi*pi+1 = (pi+ d)2 – d2.

Let m denote a block of digits which is concatenated with itself. Then questions 1 and 2 can be considered in the equation

                  (pi+ d)2 – d2 = m(10^n + 1) ± 1                                                 (1)

where n is a positive integer and the upper(lower) sign corresponds to ascending(descending) order of concatenation.

Then equation (1) implies the corresponding congruences

                        x2 =  (pi+ d)2 == d2 + 1 (mod 10^n + 1)                                    (2a)

and                    x2 =  (pi+ d)2 == d2 - 1 (mod 10^n + 1)                                    (2 b)

Then for given values of d and n, any solution x for either congruence one can easily check whether both x + d and x-d are consecutive primes. From here on, we look at only congruence (2a) since the discussion easily adapts for congruence (2b)

Let a = d2 + 1 and let (a/pj) be the Legendre symbol which shows that the congruence x2 == d2 + 1 (mod pj) is solvable for a prime pj whenever let (a/pj) =1 and pj divides 10^n +1. Consulting a table of Factors of Qn = 10n + 1 1 and a table of Quadratic Residues: (a/p) = +1, which show linear forms of primes for which the congruence x2 == a (mod pj) is solvable, one can ascertain which values of d2+1and the corresponding form of pj must be tested.

For example: for n=8, we have 108 +1 = 17*5882353. Since both primes are of the form 8m +1, one needs to examine congruences of the form x2 == d2 + 1 (mod p) where p = 17 and 5882353. Here d=1, 2 and 7 gives d2 + 1 =2, 5 and 50

respectively in congruence )(2a) and for d2- 1=1and 3 we have d2-1 = 0 and 8 respectively in congruence (2b). After combining the solutions generated using the Chinese Remainder Theorem, only the solution                                              x == 4999500(mod 108+1) yield the consecutive primes 4999493 and 4999507, the product of which is 24995000249951. By adding two initial zeroes, we have a new solution to question 1.

1.       Hans Riesel,Prime Numbers and Computer Methods for Factorization, Birkhauser , (1985), pp. 400-403.

2.       Ibid. pp.438-441.


Giovanni Resta wrote on April 11, 2019:


The solutions I found when I submitted the puzzle were

891077215721081784886888257701070827 *
891077215721081784886888257701070829 =
794018604377235322848433897872605582 ||

(b) 4803478892324963 * 4803478892324969 =
2307340946901148 || 2307340946901147

where || stands for concatenation.

Note that in case (a) the two primes are twin primes.

The approach was simple. I show case (a) since (b) uses the same method.

Say that p and q = p+g (g is the gap between the two primes)
are the two consecutive primes and I want their
product to be the concatenation of x and x+1. We can assume that x and 
x+1 have the same number of digits (because otherwise one should be 
10^k-1 and the other 10^k, and these cases can be checked separately).

Assuming that x and x+1 have d digits, the concatenation of x and x+1 is 
simply  x*10^d + (x+1).

So we have a Diophantine equation of the form  p*(p+g) = x*10^d + (x+1).

If we fix g and d, it is a quadratic Diophantine equation with the 
further constraint 10^(d-1) <= x < 10^d because x must have d digits, 
otherwise x*10^d + (x+1) is not the concatenation of x and x+1.

This kind of equation can be solved with Mathematica or Maple (and 
probably with other softwares).

For example, if g=4 and d=2 the equation become p(p+4) = 100x+x+1. This 
equation has infinite solutions, but with the constraint 10<=x<100 has 
only two  (p=54 x=31) and (p=43, x=20). What I have to do now is to
check if p in the solution is prime and if p+g is the next prime. This 
is true for p=43, because p+4=47 is the next prime.

So what I did was to compute the solution of a bunch of equations for
fixed values of d and g. Note that g (the gap between the two primes) 
can be reasonably bounded once d is fixed, because p will be roughly of 
the same size of x, so around 10^d.

In general it is conjectured that the maximal gap between two primes 
grows proportionally to the square of log(p). So for each length d I 
established a finite range for g.

When d grows the value of (log 10^d)^2 becomes quite large, and also 
solving the Diophantine equations become slower. Being a little 
impatient, I fixed an upper bound of g<4000 for the gaps up to d=50, and 
then an upper bound g<1000 for 50<d<=63.

With these constraints, I did not find any other solution for (a). For 
(b) I stopped earlier at d=58 but I found another solution:


and p*q =

6866408609426233220587132313827017515323918295230 ||






Records   |  Conjectures  |  Problems  |  Puzzles