A072047 Number of prime factors of the squarefree numbers: omega(A005117(n)).
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, 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, 3, 2, 1, 3, 2, 2, 2, 2, 2, 1, 2, 3, 1, 2, 2, 1, 3, 1, 2
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Rafael Jakimczuk and Matilde Lalín, The Number of Prime Factors on Average in Certain Integer Sequences, Journal of Integer Sequences, Vol. 25 (2022), Article 22.2.3.
Programs
-
Haskell
a072047 n = a072047_list !! (n-1) a072047_list = map a001221 $ a005117_list -- Reinhard Zumkeller, Aug 08 2011
-
Mathematica
PrimeOmega[Select[Range[200],SquareFreeQ]] (* Harvey P. Dale, May 14 2011 *)
-
PARI
apply(omega, select(issquarefree, [1..200])) \\ Michel Marcus, Nov 25 2022
-
Python
from math import isqrt from sympy import mobius, primenu def A072047(n): def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)) def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax return primenu(bisection(f)) # Chai Wah Wu, Aug 31 2024
Comments