OFFSET
1,6
COMMENTS
A one-line proof looks like this: 101 = 2*3*3*7 - 5*5. For each prime Q up to the square-root of p(n), either the left product or the right product is divisible by Q, but not both. It follows that the difference is not divisible by any such Q and so is prime. The sequence gives the right (smaller) number.
The idea comes from seqfan postings by Donald S. McDonald and David W. Wilson.
REFERENCES
R. K. Guy, Lacampagne and J. Selfridge, Primes at a glance, Math Comput 48(1987) 183-202; Math. Rev. 87m:11008.
EXAMPLE
a(6)=2: The 6th prime is 13 and the equation 13 = 3*5 - 2 proves it.
MATHEMATICA
a[p_] := Module[{prod, k}, prod=Times@@Prime/@Range[PrimePi[Sqrt[p]]]; For[k=1, True, k++, If[GCD[p, k]==1&&Mod[k*(p+k), prod]==0, Return[a[p]=k]]]]; a/@Prime/@Range[70]
CROSSREFS
KEYWORD
nonn
AUTHOR
Don Reble, Feb 20 2003
EXTENSIONS
Edited by Dean Hickerson, Feb 24 2003
STATUS
approved