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.

A126706 Positive integers which are neither squarefree integers nor prime powers.

Original entry on oeis.org

12, 18, 20, 24, 28, 36, 40, 44, 45, 48, 50, 52, 54, 56, 60, 63, 68, 72, 75, 76, 80, 84, 88, 90, 92, 96, 98, 99, 100, 104, 108, 112, 116, 117, 120, 124, 126, 132, 135, 136, 140, 144, 147, 148, 150, 152, 153, 156, 160, 162, 164, 168, 171, 172, 175, 176, 180, 184, 188
Offset: 1

Views

Author

Leroy Quet, Feb 11 2007

Keywords

Examples

			45 is in the sequence because 45=3^2*5, i.e., neither squarefree nor a prime power.
		

Crossrefs

Programs

  • Maple
    with(numtheory): a:=proc(n) if mobius(n)=0 and nops(factorset(n))>1 then n else fi end: seq(a(n), n=1..230); # Emeric Deutsch, Feb 17 2007
  • Mathematica
    Select[Range[200], Max @@ Last /@ FactorInteger[ # ] >1 && Length[FactorInteger[ # ]] > 1 &] (* Ray Chandler, Feb 17 2007 *)
    Select[Range[200],!SquareFreeQ[#]&&!PrimePowerQ[#]&] (* Harvey P. Dale, Aug 05 2023 *)
  • PARI
    isok(k) = !issquarefree(k) && !isprimepower(k); \\ Michel Marcus, Nov 02 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, integer_nthroot, mobius
    def A126706(n):
        def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length()))+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Aug 15 2024

Extensions

Extended by Emeric Deutsch and Ray Chandler, Feb 17 2007