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.

A072776 Exponents of powers of squarefree numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 10 2002

Keywords

Comments

A072774(n) = A072775(n)^a(n);
A072774(n) is squarefree iff a(n)=1.

Crossrefs

Cf. A052409.

Programs

  • Haskell
    a072776 n = a072776_list !! (n-1)  -- a072776_list defined in A072774.
    -- Reinhard Zumkeller, Apr 06 2014
    
  • Python
    from math import isqrt
    from sympy import mobius, integer_nthroot, perfect_power
    def A072776(n):
        def g(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)))-1
        def f(x): return n-2+x-sum(g(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length()))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return 1 if not (p:=perfect_power(kmax)) else p[1] # Chai Wah Wu, Aug 19 2024