%I #42 Sep 15 2024 02:46:51
%S 12,18,20,24,28,40,44,45,48,50,52,54,56,60,63,68,75,76,80,84,88,90,92,
%T 96,98,99,104,112,116,117,120,124,126,132,135,136,140,147,148,150,152,
%U 153,156,160,162,164,168,171,172,175,176,180,184,188,189,192,198,204,207,208,212,220,224
%N Nonsquarefree numbers that are not squareful.
%C Sometimes nonsquarefree numbers are misnamed squareful numbers (see 1st comment of A013929). Indeed, every squareful number > 1 is nonsquarefree, but the converse is false. This sequence = A013929 \ A001694 and consists of these counterexamples.
%C This sequence is not a duplicate: the first 16 terms (<= 68) are the same first 16 terms of A059404, A323055, A242416 and A303946, then 72 is the 17th term of these 4 sequences. Also, the first 37 terms (<= 140) are the same first 37 terms of A317616 then 144 is the 38th term of this last sequence.
%C From _Amiram Eldar_, Sep 17 2023: (Start)
%C Called "hybrid numbers" by Jakimczuk (2019).
%C These numbers have a unique representation as a product of two numbers > 1, one is squarefree (A005117) and the other is powerful (A001694).
%C Equivalently, numbers k such that A055231(k) > 1 and A057521(k) > 1.
%C Equivalently, numbers that have in their prime factorization at least one exponent that is equal to 1 and at least one exponent that is larger than 1.
%C The asymptotic density of this sequence is 1 - 1/zeta(2) (A229099). (End)
%H Michael De Vlieger, <a href="/A332785/b332785.txt">Table of n, a(n) for n = 1..10000</a>
%H Rafael Jakimczuk, <a href="http://dx.doi.org/10.13140/RG.2.2.17010.45765">Powerful Numbers Multiple of a Set of Primes and Hybrid Numbers</a>, 2019.
%F This sequence is A126706 \ A286708.
%F Sum_{n>=1} 1/a(n)^s = 1 + zeta(s) - zeta(s)/zeta(2*s) - zeta(2*s)*zeta(3*s)/zeta(6*s), s > 1. - _Amiram Eldar_, Sep 17 2023
%e 18 = 2 * 3^2 is nonsquarefree as it is divisible by the square 3^2, but it is not squareful because 2 divides 18 but 2^2 does not divide 18, hence 18 is a term.
%e 72 = 2^3 * 3^2 is nonsquarefree as it is divisible by the square 3^2, but it is also squareful because primes 2 and 3 divide 72, and 2^2 and 3^2 divide also 72, so 72 is not a term.
%p filter:= proc(n) local F;
%p F:= ifactors(n)[2][..,2];
%p max(F) > 1 and min(F) = 1
%p end proc:
%p select(filter, [$1..1000]); # _Robert Israel_, Sep 15 2024
%t Select[Range[225], Max[(e = FactorInteger[#][[;;,2]])] > 1 && Min[e] == 1 &] (* _Amiram Eldar_, Feb 24 2020 *)
%o (PARI) isok(m) = !issquarefree(m) && !ispowerful(m); \\ _Michel Marcus_, Feb 24 2020
%o (Python)
%o from math import isqrt
%o from sympy import mobius, integer_nthroot
%o def A332785(n):
%o def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o def f(x):
%o c, l, j = n-1+squarefreepi(integer_nthroot(x,3)[0])+squarefreepi(x), 0, isqrt(x)
%o while j>1:
%o k2 = integer_nthroot(x//j**2,3)[0]+1
%o w = squarefreepi(k2-1)
%o c += j*(w-l)
%o l, j = w, isqrt(x//k2**3)
%o return c-l
%o return bisection(f,n,n) # _Chai Wah Wu_, Sep 14 2024
%Y Cf. A005117 (squarefree), A013929 (nonsquarefree), A001694 (squareful), A052485 (not squareful).
%Y Cf. A059404, A126706, A229099, A242416, A286708, A303946, A317616, A323055 (first terms are the same).
%K nonn,easy
%O 1,1
%A _Bernard Schott_, Feb 24 2020