OFFSET
0,5
COMMENTS
As of today, the first unknown value is a(397).
For all n = 4, ..., 396, we know a way to write n = a +/- b where the prime factors of a*b are exactly all primes <= sqrt(n). This sequence lists min(a,b), with a minus sign if n = a + b (to have a(n) > 0 for most n).
If n is a prime, this value constitutes a proof of its primality, since then either a or b, but not both, and thus n, are nonzero (mod p) for each prime < sqrt(n).
Are a(152) = -42 and a(167) = -35 the last two negative values? - M. F. Hasler, Feb 17 2024
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..315, Feb 17 2024
Several users at mersenneforum.org, A well-known puzzle..., February 2009.
EXAMPLE
For n < 4, a(n) = 0 by convention, or with the justification that there are no primes <= sqrt(n), and 0*(n+0) = 0 also has no prime factors (by convention).
For all larger n, |m*(n+m)| must have at least the prime factor 2, so m = 0 can't be a solution as above for n < 4, nor can it be m = -n.
For n = 4, a(4) = -2 because 2*(4-2) = 2*2 has only 2 as prime factor, and this is also the only prime <= sqrt(n) = 2. One easily checks that m = +-1 and m = 2 is not a solution.
For n = 5, a(5) = -1 because 1*(5-1) = 4 = 2*2 has only 2 as prime factor, which is also the only prime up to sqrt(5) ~ 2.236.
a(30) = 30 because 30*(30+30) = 1800 = 2^3 * 3^2 * 5^2 has exactly all primes < sqrt(30) ~ 5.5 as prime factors, and one can check that no smaller m yields a solution.
PROG
(PARI) A159272(n, oo=oo, start=1)={n>3 || return(0); my(p=primes([1, sqrtint(n)])~, P=p[#p]); for(m=start, oo, m>1 && vecmax(factor(m)[, 1]) > P && next; factor(m*(m+n))[, 1]==p && return(m); factor(m*abs(m-n))[, 1]==p && return(-m))} \\ Edited to simplify, speed up & fix a bug. - M. F. Hasler, Feb 17 2024
CROSSREFS
KEYWORD
sign
AUTHOR
M. F. Hasler, Apr 09 2009
EXTENSIONS
a(30) corrected (thanks to a remark from Don Reble) and a(n) changed to 0 for n < 4 by M. F. Hasler, Feb 17 2024
STATUS
approved