OFFSET
4,2
COMMENTS
LINKS
Chai Wah Wu, Table of n, a(n) for n = 4..70
EXAMPLE
Let quality Q represent a number k that is neither squarefree nor prime power. For instance, Q(k) is true if and only if Omega(k) > omega(k) > 1, i.e., A001222(k) > A001221(k) > 1.
a(4) = 1 since there is one number k = 12 such that Q(k) is true; 12 < 2^4.
a(5) = 5 since there are 5 numbers k such that Q(k) is true; {12, 18, 20, 24, 28} are less than 2^5.
MAPLE
filter:= proc(n) local F;
F:= ifactors(n)[2];
nops(F) > 1 and max(F[.., 2]) > 1
end proc:
R:= NULL: v:= 0:
for i from 4 to 20 do
v:= v + nops(select(filter, [$2^(i-1)+1 .. 2^i-1]));
R:= R, v;
od:
R; # Robert Israel, Jun 09 2024
MATHEMATICA
nn = 2^20; m = 2; c = 0;
Reap[Do[If[Nor[PrimePowerQ[n], SquareFreeQ[n]], c++];
If[n >= m, m *= 2; Sow[c]], {n, nn}] ][[-1, 1]]
PROG
(Python)
from math import isqrt
from sympy import mobius, nextprime, integer_log
def A372403(n):
m, p = (1<<n)-1, 2
q = isqrt(m)
r = m-sum(mobius(k)*(m//k**2) for k in range(1, q+1))
while p<=q:
r -= integer_log(m, p)[0]-1
p = nextprime(p)
return r # Chai Wah Wu, Jun 10 2024
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Michael De Vlieger, Jun 09 2024
EXTENSIONS
a(30) onwards from Chai Wah Wu, Jun 10 2024
STATUS
approved