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.
%I A372433 #19 Feb 14 2025 19:39:56 %S A372433 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, %T A372433 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, %U A372433 5,6,4,4,5,5,6,5,6,7,2,2,3,3,3,3,3,4,4 %N A372433 Binary weight (number of ones in binary expansion) of the n-th squarefree number. %H A372433 Harvey P. Dale, <a href="/A372433/b372433.txt">Table of n, a(n) for n = 1..1000</a> %H A372433 MathOverflow, <a href="http://mathoverflow.net/questions/22629">Are there primes of every Hamming weight?</a> %H A372433 Wikipedia, <a href="https://en.wikipedia.org/wiki/Hamming_weight">Hamming weight</a>. %F A372433 a(n) = A000120(A005117(n)). %F A372433 a(n) + A372472(n) = A372475(n) = A070939(A005117(n)). %t A372433 DigitCount[Select[Range[100],SquareFreeQ],2,1] %t A372433 Total[IntegerDigits[#,2]]&/@Select[Range[200],SquareFreeQ] (* _Harvey P. Dale_, Feb 14 2025 *) %o A372433 (Python) %o A372433 from math import isqrt %o A372433 from sympy import mobius %o A372433 def A372433(n): %o A372433 def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)) %o A372433 m, k = n, f(n) %o A372433 while m != k: %o A372433 m, k = k, f(k) %o A372433 return int(m).bit_count() # _Chai Wah Wu_, Aug 02 2024 %Y A372433 Restriction of A000120 to A005117. %Y A372433 For prime instead of squarefree we have A014499, zeros A035103. %Y A372433 Counting zeros instead of ones gives A372472, cf. A023416, A372473. %Y A372433 For binary length instead of weight we have A372475. %Y A372433 A003714 lists numbers with no successive binary indices. %Y A372433 A030190 gives binary expansion, reversed A030308. %Y A372433 A048793 lists positions of ones in reversed binary expansion, sum A029931. %Y A372433 A145037 counts ones minus zeros in binary expansion, cf. A031443, A031444, A031448, A097110. %Y A372433 A371571 lists positions of zeros in binary expansion, sum A359359. %Y A372433 A371572 lists positions of ones in binary expansion, sum A230877. %Y A372433 A372515 lists positions of zeros in reversed binary expansion, sum A359400. %Y A372433 A372516 counts ones minus zeros in binary expansion of primes, cf. A177718, A177796, A372538, A372539. %Y A372433 Cf. A039004, A049093, A049094, A059015, A069010, A070939, A073642, A211997, A368494, A372474. %K A372433 nonn,base %O A372433 1,3 %A A372433 _Gus Wiseman_, May 04 2024