login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A159273
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.
1
-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, -2, -4, 7, -22, -21, 28, 15, -44, 14, 63, 35, -35, 520, 910, 105, 264, 990, 1155, 165, 504, 1625, 2860, 156, 495, 91, 539, 750, 198, 507, 550, 275, 143, 720, 770, 2002, 2618
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.
FORMULA
a(n) = A159273(A000040(n)).
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
Sequence in context: A213812 A143486 A257820 * A021749 A316629 A254175
KEYWORD
sign
AUTHOR
M. F. Hasler, Apr 09 2009
STATUS
approved