Problems & Puzzles: Puzzles

Puzzle 887. p(n)^c-2 is prime

Sebastián Martín Ruiz sent the following puzzle.

Compute the smallest c value such that p(n)^c-2 is prime, where p(n) is the n-th prime number.

Here are the first five solutions:

2^2-2
3^2-2
5^1-2
7^1-2
11^4-2
...

Sebastian sent the first 28 terms of this sequence:

2,2,1,1,4,1,6,1,24,2,1,2,4,1,2,4,4,1,3,2,1,38,4,2,747,4,1,2...

Q1.  Extend this sequence

Q2. Exist a c for every n?

Q3. Is this sequence related to another registered in OEIS?

 

Contributions came from Jan van Delden, Jeff Heleen, Emmanuel Vantieghem and J. K. Andersen.

***

Jan wrote:

Q1. It is not hard to extent this table.

 

[109,1],[113,10],[127,2],[131,2],[137,10],[139,1],[149,50],[151,1],[157,22],[163,38],

[167,12],[173,2],[179,40],[181,1],[191,2],[193,1],[197,164],[199,1],[211,2],[223,2],

[227,12],[229,1],[233,2],[239,2],[241,1],[251,8],[257,2],[263,18], [269,22],[271,1],

[277,3],[281,10],[283,1],[293,2],[307,102],[311,4],[313,1],[317,???]

 

However there exists  primes for which it is hard to show whether c exists or does not exist.
I investigated this sequence until prime 29027. The primes with odd c are rare.

 

We also have that the primes [521,9007] give c=666.

 

Q2. The first few primes for which c is hard to establish (c>1000), if present, are:

[317,347,353,397,487,641,739,809,1151,1181,1193]

 

In order to proof that no c exists for a certain prime p one could try to find a covering set.
I tried this for a few primes in the given list above.

 

p^k-2 mod q = (p mod q)^(k mod phi(q))-2 mod q = 0 mod q

If q=3 it reads  (p mod 3)^(k mod 2) mod q = 2 mod q.

So q=3 is a divisor of p^k-2 if p=2 mod 3 and k=1 mod 2. (And q=3 is not a divisor if k=0 mod 2).


For p=317 one could find a whole set of rules governing k. A simple rule using only divisors of 317-2 would be to only test k=0,2 mod 6.
But I couldn’t find a complete covering set, i.e. couldn’t exclude 0 or 2 mod 6. So 317 might give a solution. [I tested this one for c<=11000].

 

As a sidenote it makes sense that there are only a few primes with odd c, because (p mod q) and phi(q) are always even: q is a divisor if k is an odd number. So either q is equal to p^k-2 and we found a value for c, or we have found a divisor (and a rule to exclude other values for k). Since we tend find many rules to exclude odd k, most solutions will have an even power.

***

Jeff wrote:

 I found the following for primes less than 500 (except 317, 347, 353,

397 and 487):

 

 P      C
109    1
113    10
127    2
131    2
137    10
139    1
149    50
151    1
157    22
163    38
167    12
173    2
179    40
181    1
191    2
193    1
197    164
199    1
211    2
223    2
227    12
229    1
233    2
239    2
241    1
251    8
257    2
263    18
269    22
271    1
277    3
281    10
283    1
293    2
307    102
311    4
313    1
317    >1043
331    12
337    2
347    >1027
349    1
353    >1024
359    2
367    3
373    6
379    46
383    6
389    4
397    >1004
401    14
409    4
419    106
421    1
431    6
433    1
439    3
443    2
449    2
457    3
461    56
463    1
467    2
479    268
487    >971
491    2
499    27

***

Emmanuel wrote:

1. The sequence continues with
1, 10, 2, 2, 10, 1, 50, 1, 22, 38, 12, 2, 40, 1, 2, 1, 164, 1, 2, 2, 12, 1, 2, 2, 1, 8, 2, 18, 22, 1, 3, 10, 1, 2, 102, 4, 1
The last element correspond to the prime  313.  Concerning the next prime, 317 we found  317^n - 2  composite for all  n < 5500.
Could this be the answer to  Q2 ?  I guess not, but it can take a lot of time to verify this.
 
 Q2.  See  Q3.
 
 Q3. The sequence is a subsequence of   A255707.
There one does not restrict the problem to prime base  p(n)  but to the sequence of odd numbers.
So, I think we should first answer the question if there are odd integers  c  such that  c^n - 2  is composite for every  n.
At present, I do not know off such a number.  The first possible candidate is  305  (305^n - 2  is composite for all  n < 4000).
But, even when we find a prime  305^n - 2, that number will be so big that proving its primality can cost weeks (or months or years ...).
Another possibility is that there might exist an odd number  k  and a set of prime numbers  P1, P2, ... , Ps  such that,
for every  n, the number  k^n - 2  is divisible by at least one of the primes  Pi ( i.e. : the set  { P1, ..., Ps }  is a covering
set for the sequence of numbers  { k^n - 2 | n = 1, 2, ... }).  But, of course, that's another (very difficult) problem.

***

Andersen wrote:

Q1. A search with PrimeForm/GW says term 29 to 70 are:
1, 10, 2, 2, 10, 1, 50, 1, 22, 38, 12, 2, 40, 1, 2, 1, 164, 1, 2, 2, 12,
1, 2, 2, 1, 8, 2, 18, 22, 1, 3, 10, 1, 2, 102, 4, 1, 13896, 12, 2, 1122, 1
Two of them correspond to the probable primes 317^13896-2 and 347^1122-2.
The term for p(71)=353 is above 20000, assuming it exists.

Q3. Apart from the first term, this is a subsequence of A255707:
"Least number k > 0 such that (2*n-1)^k - 2 is prime, or 0 if no such number exists."

***


Records   |  Conjectures  |  Problems  |  Puzzles