%I #34 Sep 21 2024 14:36:33
%S 0,1,1,1,2,1,2,1,1,2,2,1,1,2,2,1,2,1,3,1,2,2,2,1,2,2,1,3,1,2,1,2,1,2,
%T 2,2,1,1,2,2,3,1,2,3,1,1,2,2,3,1,2,1,2,2,2,1,2,2,2,2,1,1,3,1,3,2,1,1,
%U 3,2,1,3,2,2,2,2,2,1,2,3,1,2,2,1,3,1,2
%N Number of prime factors of the squarefree numbers: omega(A005117(n)).
%C For n > 1: length of row n in A265668. - _Reinhard Zumkeller_, Dec 13 2015
%H Reinhard Zumkeller, <a href="/A072047/b072047.txt">Table of n, a(n) for n = 1..10000</a>
%H Rafael Jakimczuk and Matilde Lalín, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Lalin/lalin2.html">The Number of Prime Factors on Average in Certain Integer Sequences</a>, Journal of Integer Sequences, Vol. 25 (2022), Article 22.2.3.
%F a(n) = A001221(A005117(n)) = A001222(A005117(n)).
%F Sum_{A005117(k) <= x} a(k) = (1/zeta(2))*x*log(log(x)) + O(x) (Jakimczuk and Lalín, 2022). - _Amiram Eldar_, Feb 18 2023, corrected Sep 21 2024
%t PrimeOmega[Select[Range[200],SquareFreeQ]] (* _Harvey P. Dale_, May 14 2011 *)
%o (Haskell)
%o a072047 n = a072047_list !! (n-1)
%o a072047_list = map a001221 $ a005117_list
%o -- _Reinhard Zumkeller_, Aug 08 2011
%o (PARI) apply(omega, select(issquarefree, [1..200])) \\ _Michel Marcus_, Nov 25 2022
%o (Python)
%o from math import isqrt
%o from sympy import mobius, primenu
%o def A072047(n):
%o def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o return primenu(bisection(f)) # _Chai Wah Wu_, Aug 31 2024
%Y Cf. A072048.
%Y Cf. A001221, A001222, A013661, A005117, A265668.
%K nonn,nice
%O 1,5
%A _Reinhard Zumkeller_, Jun 09 2002