A058233 Primes p such that p#+1 is divisible by the next prime after p.
2, 17, 1459, 2999
Offset: 1
Examples
2*3*5*7*11*13*17+1 is divisible by 19.
Links
- Carlos Rivera, Puzzle 117: Certain p#+1 values, The Prime Puzzles and Problems Connection.
Programs
-
Mathematica
primorial[n_] := Product[ Prime[k], {k, 1, PrimePi[n]}]; Select[ Prime[ Range[1000]], Divisible[ primorial[#] + 1, NextPrime[#]] &] (* Jean-François Alcover, Aug 19 2013 *) 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 *)
-
Python
from sympy import nextprime A058233_list, p, q, r = [], 2, 3, 2 for _ in range(10**3): if (r+1) % q == 0: A058233_list.append(p) r *= q p, q = q, nextprime(q) # Chai Wah Wu, Sep 27 2021
Comments