login
A372433
Binary weight (number of ones in binary expansion) of the n-th squarefree number.
25
1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 5, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 5, 4, 4, 5, 4, 4, 5, 5, 5, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 5, 3, 4, 4, 4, 5, 4, 5, 5, 5, 6, 3, 4, 4, 5, 4, 4, 5, 5, 5, 6, 4, 4, 5, 5, 6, 5, 6, 7, 2, 2, 3, 3, 3, 3, 3, 4, 4
OFFSET
1,3
FORMULA
a(n) = A000120(A005117(n)).
a(n) + A372472(n) = A372475(n) = A070939(A005117(n)).
MATHEMATICA
DigitCount[Select[Range[100], SquareFreeQ], 2, 1]
PROG
(Python)
from math import isqrt
from sympy import mobius
def A372433(n):
def f(x): return n+x-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 int(m).bit_count() # Chai Wah Wu, Aug 02 2024
CROSSREFS
Restriction of A000120 to A005117.
For prime instead of squarefree we have A014499, zeros A035103.
Counting zeros instead of ones gives A372472, cf. A023416, A372473.
For binary length instead of weight we have A372475.
A003714 lists numbers with no successive binary indices.
A030190 gives binary expansion, reversed A030308.
A048793 lists positions of ones in reversed binary expansion, sum A029931.
A145037 counts ones minus zeros in binary expansion, cf. A031443, A031444, A031448, A097110.
A371571 lists positions of zeros in binary expansion, sum A359359.
A371572 lists positions of ones in binary expansion, sum A230877.
A372515 lists positions of zeros in reversed binary expansion, sum A359400.
A372516 counts ones minus zeros in binary expansion of primes, cf. A177718, A177796, A372538, A372539.
Sequence in context: A368869 A128330 A133801 * A181630 A112310 A350240
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, May 04 2024
STATUS
approved