OFFSET
1,12
COMMENTS
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.
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.
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.
LINKS
Several users at mersenneforum.org, A well-known puzzle..., February 2009.
EXAMPLE
a(1)=-1 since |-1*(2-1)|=1 has no prime factors, i.e. exactly the primes less than sqrt(2): There are none.
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.
a(3)=-1 since prime(3)=5=1+2^2, thus |-1*(5-1)|=2^2 has {2}={primes < sqrt(5)} as prime factors.
a(4)=1 since prime(4)=7=2^3-1, thus |1*(7+1)|=2^3 has {2}={primes < sqrt(7)} as prime factors.
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).
PROG
(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))}
CROSSREFS
KEYWORD
sign
AUTHOR
M. F. Hasler, Apr 09 2009
STATUS
approved