%I #13 Jan 08 2024 01:40:26
%S 0,0,0,0,0,1,0,0,0,1,0,2,0,1,1,0,0,2,0,2,1,1,0,3,0,1,0,2,0,3,0,0,1,1,
%T 1,4,0,1,1,3,0,3,0,2,2,1,0,4,0,2,1,2,0,3,1,3,1,1,0,5,0,1,2,0,1,3,0,2,
%U 1,3,0,6,0,1,2,2,1,3,0,4,0,1,0,5,1,1,1
%N Number of divisors of n with exactly two distinct prime factors.
%H Amiram Eldar, <a href="/A367098/b367098.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = (A001222(n)^2 - A090885(n))/2. - _Amiram Eldar_, Jan 08 2024
%e The a(n) divisors for n = 1, 6, 12, 24, 36, 60, 72, 120, 144, 216, 288, 360:
%e . 6 6 6 6 6 6 6 6 6 6 6
%e 12 12 12 10 12 10 12 12 12 10
%e 24 18 12 18 12 18 18 18 12
%e 36 15 24 15 24 24 24 15
%e 20 36 20 36 36 36 18
%e 72 24 48 54 48 20
%e 40 72 72 72 24
%e 144 108 96 36
%e 216 144 40
%e 288 45
%e 72
%t Table[Length[Select[Divisors[n], PrimeNu[#]==2&]],{n,100}]
%t a[1] = 0; a[n_] := (Total[(e = FactorInteger[n][[;; , 2]])]^2 - Total[e^2])/2; Array[a, 100] (* _Amiram Eldar_, Jan 08 2024 *)
%o (PARI) a(n) = {my(e = factor(n)[, 2]); (vecsum(e)^2 - e~*e)/2;} \\ _Amiram Eldar_, Jan 08 2024
%Y For just one distinct prime factor we have A001222 (prime-power divisors).
%Y This sequence counts divisors belonging to A007774.
%Y Counting all prime factors gives A086971, firsts A220264.
%Y Column k = 2 of A146289.
%Y - Positions of zeros are A000961 (powers of primes), complement A024619.
%Y - Positions of ones are A006881 (squarefree semiprimes).
%Y - Positions of twos are A054753.
%Y - Positions of first appearances are A367099.
%Y A001221 counts distinct prime factors.
%Y A001358 lists semiprimes, complement A100959.
%Y A367096 lists semiprime divisors, sum A076290.
%Y Cf. A000005, A001248, A056170, A079275, A090885, A366740.
%K nonn,easy
%O 1,12
%A _Gus Wiseman_, Nov 09 2023