%I #17 Oct 11 2021 13:22:01
%S 0,0,1,0,1,1,1,0,3,2,1,1,1,3,5,0,1,7,1,1,5,3,1,3,7,7,9,1,3,23,1,1,11,
%T 7,15,7,3,7,5,1,3,31,1,3,31,15,3,3,3,31,23,3,3,31,23,3,11,3,7,7,1,15,
%U 31,1,31,31,3,5,11,47,3,15,3,15,47,7,31,383,1,3
%N a(n) is the number of pair of positive integers (x, y) with 1 <= x <= y such that sum s = x + y and product p = x * y satisfy s + p = 2^n, with n > 0.
%C That is a generalization of a problem proposed by French site Diophante in link.
%C Some results:
%C x and y satisfy (x+1)*(y+1) = 2^n + 1.
%C x and y are both even, so 2 <= x <= y < 2^n.
%C There is only one case such that x = y, it is for n = 3 with x = y = 2 (Examples).
%C a(n) = 0 iff 2^n+1 is Fermat prime (A019434), hence iff n = 1, 2, 4, 8, 16.
%C a(n) = 1 iff 2^n+1 is semiprime (n is in A092559).
%H Diophante, <a href="http://www.diophante.fr/problemes-par-themes/arithmetique-et-algebre/a4-equations-diophantiennes/4561-a4921-zero-une-mille-et-plus">A4921 - Zéro, une, mille et plus</a> (in French).
%F For n<>3, the number of positive pairs solution (x,y) is a(n) = (tau(2^n+1) - 2)/2.
%F For n = 3, there is only one pair solution and a(3) = (tau(2^3+1) - 1)/2 = 1, with (x, y) = (2, 2).
%F a(n) = ceiling((tau(2^n+1) - 2)/2) = ceiling((A046798(n)-2)/2) is the general formula.
%e For n = 3, only (x=y=2) satisfy s = 2+2 = 4, p = 2*2 = 4 and s+p = 8 = 2^3, hence a(3) = 1.
%e For n = 6, only (x=4, y=12) satisfy s = 4+12 = 16, p = 4*12 = 48 and s+p = 64 = 2^6 hence a(6) = 1.
%e For n = 9, (2,170), (8,56), (18,26) are the 3 solutions, with 172+340=512=2^9, 64+448=512, 44+468=512, hence a(9) = 3.
%e For n = 10, (4, 204) and (24, 40) are the 2 solutions, with 208+816=1024=2^10 and 64+960=1024, hence a(10) = 2.
%p with(numtheory):
%p M := seq(ceil((tau(2^n+1)-2)/2), n=1..100);
%t a[3] = 1; a[n_] := DivisorSigma[0, 2^n + 1]/2 - 1; Array[a, 80] (* _Amiram Eldar_, Oct 05 2021 *)
%o (PARI) a(n) = ceil((numdiv(2^n+1) - 2)/2); \\ _Michel Marcus_, Oct 11 2021
%Y Cf. A046798, A092559, A019434.
%K nonn
%O 1,9
%A _Bernard Schott_, Oct 05 2021