OFFSET
1,1
COMMENTS
A one-line proof looks like this: 149 = 5*5*11 - 2*3*3*7. 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. Multiply the left and right products together, then divide out each Q once, the sequence gives the remaining product.
The generating program listed for A079900 tries every k from 1 up until a solution is found. A study of this sequence was used to design a generating program that skips k values where i*Q# < k*(p+k) << (i+1)*Q#.
EXAMPLE
a(28) = 18 because prime(28) = 107, A079900(28) = 28 and 28*(107 + 28) = 3780 = (2*3*5*7)*18.
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*(p+k)/prod]]]]; a/@Prime/@Range[70]
CROSSREFS
KEYWORD
nonn
AUTHOR
Bruce A. Leenstra (leenstrb(AT)comcast.net), Aug 24 2006
STATUS
approved