login
Primes p such that p#+1 is divisible by the next prime after p.
8

%I #32 Sep 28 2021 01:26:00

%S 2,17,1459,2999

%N Primes p such that p#+1 is divisible by the next prime after p.

%C No additional terms through the 100000th prime. - _Harvey P. Dale_, Mar 12 2014

%C a(5) > prime(1400000) = 22182343. - _Robert Price_, Apr 02 2018

%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_117.htm">Puzzle 117: Certain p#+1 values</a>, The Prime Puzzles and Problems Connection.

%e 2*3*5*7*11*13*17+1 is divisible by 19.

%t primorial[n_] := Product[ Prime[k], {k, 1, PrimePi[n]}]; Select[ Prime[ Range[1000]], Divisible[ primorial[#] + 1, NextPrime[#]] &] (* _Jean-François Alcover_, Aug 19 2013 *)

%t Module[{prs=Prime[Range[500]]},Transpose[Select[Thread[{Rest[ FoldList[ Times, 1,prs]], prs}], Divisible[ First[#]+1, NextPrime[Last[#]]]&]][[2]]] (* _Harvey P. Dale_, Mar 12 2014 *)

%o (Python)

%o from sympy import nextprime

%o A058233_list, p, q, r = [], 2, 3, 2

%o for _ in range(10**3):

%o if (r+1) % q == 0:

%o A058233_list.append(p)

%o r *= q

%o p, q = q, nextprime(q) # _Chai Wah Wu_, Sep 27 2021

%Y Cf. A006862, A066735, A341804.

%K nice,nonn,more

%O 1,1

%A _Carlos Rivera_, Dec 01 2000