login
A126706
Positive integers which are neither squarefree integers nor prime powers.
120
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,1
LINKS
EXAMPLE
45 is in the sequence because 45=3^2*5, i.e., neither squarefree nor a prime power.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 11 2007
EXTENSIONS
Extended by Emeric Deutsch and Ray Chandler, Feb 17 2007
STATUS
approved