Problems & Puzzles: Puzzles

Puzzle 220. p - k! primes.

A few days ago, I was reading the following line:

"Erdos also asks if there are infinite many primes for which p - k! is composite for each k such that 1<=k!<=p" (1)

After realizing that my brain was not open for that question, I said "and what about if we ask for primes instead for composites"?

With the help of a little code I got the following p primes for which p - k! is prime for each k such that 2<=k!<p.

p kmax
5 2
13 3
19 3
43 4
103 4
2713 6
5233 7
37363 7
276043 8
277603 8
35088793 10
? ?
? ?
? ?
? ?

For example p=35088793 provides the following 9 primes p-2!, p-3!, ...p-10!, that is to say, the primes, 35088791, 35088787, 35088769, 35088673, 35088073, 35083753, 35048473, 34725913, 31459993.

Looking for the sequence of primes in the column 1 of the above Table at the Neil's Sloane On line encyclopedia sequences of integers, I discovered that they are inside of the sequence A068371 submitted by Naohiro Nomoto on March 2002 (I wonder why Naohiro included the prime "2" at the beginning of his sequence... It seems to be a flaw... I will write to him).

So, my only contribution to this sequence is the last prime, 35088793 (nothing bad for a fishing day with so bad start)


1. As you can see, there are k values for which there are no prime solutions and other for which there are multiple solutions. Anyway, is this sequence infinite?

2. Can you get four more entries for this table?

Now, it's is very natural to change from factorial to primorial, and ask for the p primes for which p - qk# is prime for each k such that 2<=qk#<p. (qk# = is the primorial qk = 2*3*...*qk).

In doing so, I have found a similar table than the one above, but with much more rows than that one. The last row I have calculated is this one:

p kmax
3781378039 (and my PC still running) 9

3. Can you explain why this second Table has so many solutions or at least much more than the first Table ? Is this Table infinite?


(1) P.7, UPiNT, Vol. 1, R.K.Guy.


J. K. Andersen wrote:

Question 1

I have no proof but some quick heuristics indicate there is probably a finite number of solutions, maybe only the given.

Question 2

My search says there are no more solutions for p<18!, corresponding to kmax<18.

Question 3

q_k# (product of first k primes) grows much faster than k! since only some numbers are primes. Assuming some independence of primality chances, this means there is a much better chance of finding k simultaneous primes below q_k# than k-1 primes below k! Example for k=18: 18! ~ 6.4*10^15 and q_18# = 61# ~ 1.2*10^23. The interval in which to find 18 primes for q_18# is around 19 million times larger than the 17 primes for 18! I have not computed heuristics indicating whether there are infinitely many solutions for q_k#.


Records   |  Conjectures  |  Problems  |  Puzzles