%I #55 Dec 25 2020 13:18:22
%S 2,2,2,0,1,0,1,4,0,0,1,2,4,0,0,1,2,4,4,16,0,0,1,9,0,0,1,2,4,4,9,2,0,0,
%T 0,1,4,0,0,1,16,4,4,9,36,0,1,9,0,1,0,1,4,16,0,1,0,0,1,9,4,0,1,9,0,1,9,
%U 64,0,1,9,2,4,0,1,25,0,1,64,25,4,0,1,49,0,0,0,1,4,4,0,1,0,0,0,1,4,4,4,9,16
%N Smallest k^2>=0 such that n-k^2 is semiprime, or a(n)=2 if there is no such k^2.
%C If n = m^2, m>=2, then the condition {a(n) differs from 2} is equivalent to the Goldbach binary conjecture. Indeed, if m^2 - k^2 is semiprime, then (m-k)*(m+k) = p*q, where p<=q are primes. Here we consider two possible cases. 1) m-k=1, m+k=p*q and 2) m-k=p, m+k=q. But in the first case k=m-1>m-p, i.e., more than k in the second case. In view of the minimality k, we only have to consider case 2). In this case we have m-/+k both are primes p<=q (with equality in case k=0) and thus 2*m = p + q. Conversely, let the Goldbach conjecture be true. Then for a perfect square n>=4, we have 2*sqrt(n)=p+q (p<=q are both primes). Thus n=((p+q)/2)^2 and n-((p-q)/2)^2=p*q is semiprime. Hence a(n) is a square not exceeding ((p-q)/2)^2.
%C Note that a(n)=2 for 1,2,3,12,17,28,32,72,...
%C All these numbers are in A100570. Thus the Goldbach binary conjecture is true if and only if A100570 does not contain perfect squares.
%C The largest term found in the first 2^28 terms is a(106956964) = 369^2 = 136161. This further encourages one to believe that Goldbach's binary conjecture holds true. - _Daniel Mikhail_, Nov 23 2020
%H Peter J. C. Moses, <a href="/A241922/b241922.txt">Table of n, a(n) for n = 1..1000</a>
%H Daniel Mikhail, <a href="https://raw.githubusercontent.com/mikhaidn/SemiprimeCalculations/main/Summary%20of%202%5E28%20results">Lists of up to the first 15 integers that are a squared distance, k^2, away from a semiprime for all k's found between [5..2^28]</a>
%F a(A001358(n)) = 0.
%o (PARI) a(n) = {my(lim = if (issquare(n), sqrtint(n)-1, sqrtint(n))); for (k=0, lim, if (bigomega(n-k^2) == 2, return (k^2));); return (2);} \\ _Michel Marcus_, Nov 26 2020
%Y Cf. A000290, A001358, A100570, A152522, A152451, A156537.
%K nonn
%O 1,1
%A _Vladimir Shevelev_, May 01 2014