%I #71 Feb 11 2023 20:34:04
%S 0,0,0,1,0,1,0,1,1,1,0,2,0,1,1,1,0,2,0,2,1,1,0,2,1,1,1,2,0,3,0,1,1,1,
%T 1,3,0,1,1,2,0,3,0,2,2,1,0,2,1,2,1,2,0,2,1,2,1,1,0,4,0,1,2,1,1,3,0,2,
%U 1,3,0,3,0,1,2,2,1,3,0,2,1,1,0,4,1,1,1,2,0,4,1,2,1,1,1,2,0,2,2,3,0,3
%N Number of semiprime divisors of n.
%C Inverse Moebius transform of A064911. - _Jonathan Vos Post_, Dec 08 2004
%D G. H. Hardy and E. M. Wright, Section 17.10 in An Introduction to the Theory of Numbers, 5th ed., Oxford, England: Clarendon Press, 1979.
%H T. D. Noe, <a href="/A086971/b086971.txt">Table of n, a(n) for n = 1..10000</a>
%H E. A. Bender and J. R. Goldman, <a href="https://www.maa.org/sites/default/files/pdf/upload_library/22/Ford/BenderGoldman.pdf">On the Applications of Mobius Inversion in Combinatorial Analysis</a>, Amer. Math. Monthly 82, (1975), 789-803.
%H M. Bernstein and N. J. A. Sloane, <a href="https://arxiv.org/abs/math/0205301">Some canonical sequences of integers</a>, arXiv:math/0205301 [math.CO], 2002; Linear Alg. Applications, 226-228 (1995), 57-72; erratum 320 (2000), 210.
%H M. Bernstein and N. J. A. Sloane, <a href="/A003633/a003633_1.pdf">Some canonical sequences of integers</a>, Linear Alg. Applications, 226-228 (1995), 57-72; erratum 320 (2000), 210. [Link to Lin. Alg. Applic. version together with omitted figures]
%H N. J. A. Sloane, <a href="/transforms.txt">Transforms</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Semiprime.html">Semiprime</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DivisorFunction.html">Divisor Function</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MoebiusTransform.html">Moebius Transform</a>.
%F a(n) = A106404(n) + A106405(n). - _Reinhard Zumkeller_, May 02 2005
%F a(n) = omega(n/core(n)) + binomial(omega(n),2) = A001221(n/A007913(n)) + binomial(A001221(n),2) = A056170(n) + A079275(n). - _Rick L. Shepherd_, Mar 06 2006
%F From _Reinhard Zumkeller_, Dec 14 2012: (Start)
%F a(n) = Sum_{k=1..A000005(n)} A064911(A027750(n,k)).
%F a(A220264(n)) = n and a(m) <> n for m < A220264(n); a(A008578(n)) = 0; a(A002808(n)) > 0; for n > 1: a(A102466(n)) <= 1 and a(A102467(n)) > 1; A066247(n) = A057427(a(n)). (End)
%F G.f.: Sum_{k = p*q, p prime, q prime} x^k/(1 - x^k). - _Ilya Gutkovskiy_, Jan 25 2017
%p a:= proc(n) local l, m; l:=ifactors(n)[2]; m:=nops(l);
%p m*(m-1)/2 +add(`if`(i[2]>1, 1, 0), i=l)
%p end:
%p seq(a(n), n=1..120); # _Alois P. Heinz_, Jul 18 2013
%t semiPrimeQ[n_] := PrimeOmega@ n == 2; f[n_] := Length@ Select[Divisors@ n, semiPrimeQ@# &]; Array[f, 105] (* Zak Seidov, Mar 31 2011 and modified by _Robert G. Wilson v_, Dec 08 2012 *)
%t a[n_] := Count[e = FactorInteger[n][[;; , 2]], _?(# > 1 &)] + (o = Length[e])*(o - 1)/2; Array[a, 100] (* _Amiram Eldar_, Jun 30 2022 *)
%o (PARI) /* The following definitions of a(n) are equivalent. */
%o a(n) = sumdiv(n,d,bigomega(d)==2)
%o a(n) = f=factor(n); j=matsize(f)[1]; sum(m=1,j,f[m,2]>=2) + binomial(j,2)
%o a(n) = f=factor(n); j=omega(n); sum(m=1,j,f[m,2]>=2) + binomial(j,2)
%o a(n) = omega(n/core(n)) + binomial(omega(n),2)
%o /* _Rick L. Shepherd_, Mar 06 2006 */
%o (Haskell)
%o a086971 = sum . map a064911 . a027750_row
%o -- _Reinhard Zumkeller_, Dec 14 2012
%Y Cf. A001358, A064911, A001221, A000005, A000010, A004018, A007913, A056170, A079275, A001222, A220264 (least inverse).
%K nonn
%O 1,12
%A _Reinhard Zumkeller_, Sep 22 2003
%E Entry revised by _N. J. A. Sloane_, Mar 28 2006