cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072047 Number of prime factors of the squarefree numbers: omega(A005117(n)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 09 2002

Keywords

Comments

For n > 1: length of row n in A265668. - Reinhard Zumkeller, Dec 13 2015

Crossrefs

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

Formula

a(n) = A001221(A005117(n)) = A001222(A005117(n)).
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