%I #36 May 20 2020 15:16:21
%S 0,1,3,6,9,13,17,23,26,33,37,45,49,59,59,74,75,89,89,103,101,123,119,
%T 139,132,161,151,175,169,193,187,219,203,243,211,260,243,287,261,297,
%U 281,327,301,351,313,381,341,401,354,421,389,451,405,483,409,489,457,537,471,547,495,593,509,610,521,645,565,669,601
%N Number of positive integer pairs (x,y) such that there exist positive integers p and q satisfying p*x + q*y = n.
%F a(n) = A302294(n) - 2*A000005(n). - _Chai Wah Wu_, May 24 2018
%e a(5)=9; all pairs are (1, 2), (3, 2), (1, 3), (3, 1), (2, 1), (1, 4), (2, 3), (4, 1), (1, 1).
%t f[n_] := {#, n/#} & /@ Divisors@ n; Array[Length@ Union@ Apply[Join, {#, Reverse /@ #}] &@ Apply[Join, Map[Apply[Join, Outer[{#1, #2} &, #1, #2, 1]][[All, All, -1]] & @@ Map[f, #] &, IntegerPartitions[#, {2}]]] &, 68, 2] (* _Michael De Vlieger_, May 14 2018 *)
%o (Python)
%o def sets(n):
%o res=set()
%o for i in range(1,n):
%o for j in range(1,i+1):
%o if i%j==0:
%o for k in range(1,n-i+1):
%o if (n-i)%(k)==0:
%o res.add((j,k))
%o return res
%o [len(sets(i)) for i in range(1,100)]
%o (PARI) isok(x, y, n) = {for (p=1, n, for (q=1, n, if (p*x+q*y ==n, return (1)););); return (0);}
%o a(n) = sum(x=1, n, sum(y=1, n, isok(x, y, n))); \\ _Michel Marcus_, May 14 2018
%o (Python)
%o from __future__ import division
%o from sympy import divisors
%o def A302292(n):
%o s = set()
%o for i in range(1,(n+3)//2):
%o for j in divisors(i):
%o for k in divisors(n-i):
%o if j != k:
%o s.add((min(j,k),max(j,k)))
%o return divisor_count(n)+2*len(s)-1 # _Chai Wah Wu_, May 24 2018
%Y Cf. A302294.
%K nonn
%O 1,3
%A _Jack Zhang_, Apr 04 2018