login
a(n) = the smallest positive number which furnishes a "one-line proof" for primality of prime(n), the n-th prime; i.e., the smallest k which is relatively prime to p such that k*(p+k) is divisible by every prime less than sqrt(p), where p=prime(n).
1

%I #11 Oct 19 2017 03:14:11

%S 1,1,1,1,1,2,1,2,1,1,5,3,4,2,3,7,21,9,3,34,32,5,7,16,8,4,2,28,21,7,

%T 203,100,28,15,126,14,63,35,253,520,910,105,264,665,1155,165,504,1155,

%U 858,156,495,91,539,715,198,507,550,275,143,720,627,2002,2618,5695,4692

%N a(n) = the smallest positive number which furnishes a "one-line proof" for primality of prime(n), the n-th prime; i.e., the smallest k which is relatively prime to p such that k*(p+k) is divisible by every prime less than sqrt(p), where p=prime(n).

%C 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.

%C The idea comes from seqfan postings by _Donald S. McDonald_ and _David W. Wilson_.

%D R. K. Guy, Lacampagne and J. Selfridge, Primes at a glance, Math Comput 48(1987) 183-202; Math. Rev. 87m:11008.

%e a(6)=2: The 6th prime is 13 and the equation 13 = 3*5 - 2 proves it.

%t 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]

%K nonn

%O 1,6

%A _Don Reble_, Feb 20 2003

%E Edited by _Dean Hickerson_, Feb 24 2003