%I #3 Jul 14 2012 11:32:24
%S -1,0,-1,1,1,-1,1,-1,1,1,-1,3,4,2,-2,7,-14,9,3,-15,-3,5,7,-5,-7,4,2,
%T -2,-4,7,-22,-21,28,15,-44,14,63,35,-35,520,910,105,264,990,1155,165,
%U 504,1625,2860,156,495,91,539,750,198,507,550,275,143,720,770,2002,2618
%N Smallest integer m, in absolute value, such that |m(prime(n)+m)| has as prime factors exactly all primes < sqrt(prime(n)); zero if no such m exists.
%C For prime(2)=3 no such integer exists, since there are no primes less than sqrt(3), but |m(3-m)|>1 for all nonzero m.
%C For all other primes up to prime(78)=397, a(n) is quickly calculated using the given code, with a(64)=19800 and a(68)=1724463 being the two largest values.
%C Since m and prime(n)-m cannot have a common prime factor, their respective prime factors form a partition of the primes <= sqrt(prime(n)). See A159273 for further details.
%H Several users at mersenneforum.org, <a href="http://www.mersenneforum.org/showthread.php?p=168693">A well-known puzzle...</a>, February 2009.
%F a(n) = A159273(A000040(n)).
%e a(1)=-1 since |-1*(2-1)|=1 has no prime factors, i.e. exactly the primes less than sqrt(2): There are none.
%e a(2)=0 since there is no (nonzero) integer m such that |m*(3+m)| has as prime factors exactly the primes less than sqrt(3), i.e. none.
%e a(3)=-1 since prime(3)=5=1+2^2, thus |-1*(5-1)|=2^2 has {2}={primes < sqrt(5)} as prime factors.
%e a(4)=1 since prime(4)=7=2^3-1, thus |1*(7+1)|=2^3 has {2}={primes < sqrt(7)} as prime factors.
%e a(77) = 2926 since prime(77) = 389 = 3315 - 2926 = 3*5*13*17 - 2*7*11*19, thus |2926*(389+2926)| = product of all primes < sqrt(389).
%o (PARI) A159273(n)={ local(P=vector(primepi(sqrtint(n=prime(n))),i,prime(i))~,M); P|return(-(n==1)); M=P[ #P]; for( m=1,n-1, factor(m*(m+n))[,1]==P & return(m); factor(m*(n-m))[,1]==P & return(-m)); for( m=1+n,9e9, vecmax(factor(m)[,1])>M & next; factor(m*(m+n))[,1]==P & return(m); factor(m*(m-n))[,1]==P & return(-m))}
%K sign
%O 1,12
%A _M. F. Hasler_, Apr 09 2009
|