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 A372516 #8 May 09 2025 16:00:31 %S A372516 0,2,1,3,2,2,-1,1,3,3,5,0,0,2,4,2,4,4,-1,1,-1,3,1,1,-1,1,3,3,3,1,7,-2, %T A372516 -2,0,0,2,2,0,2,2,2,2,6,-2,0,2,2,6,2,2,2,6,2,6,-5,-1,-1,1,-1,-1,1,-1, %U A372516 1,3,1,3,1,-1,3,3,-1,3,5,3,5,7,-1,1,-1,1,1 %N A372516 Number of ones minus number of zeros in the binary expansion of the n-th prime number. %C A372516 Absolute value is A177718. %F A372516 a(n) = A000120(A000040(n)) - A080791(A000040(n)). %F A372516 a(n) = A014499(n) - A035103(n). %F A372516 a(n) = A145037(A000040(n)) %e A372516 The binary expansion of 83 is (1,0,1,0,0,1,1), and 83 is the 23rd prime, so a(23) = 4 - 3 = 1. %t A372516 Table[DigitCount[Prime[n],2,1]-DigitCount[Prime[n],2,0],{n,100}] %t A372516 DigitCount[#,2,1]-DigitCount[#,2,0]&/@Prime[Range[100]] (* _Harvey P. Dale_, May 09 2025 *) %Y A372516 The sum instead of difference is A035100, firsts A372684 (primes A104080). %Y A372516 The negative version is A037861(A000040(n)). %Y A372516 Restriction of A145037 to the primes. %Y A372516 The unsigned version is A177718. %Y A372516 - Positions of zeros are A177796, indices of the primes A066196. %Y A372516 - Positions of positive terms are indices of the primes A095070. %Y A372516 - Positions of negative terms are indices of the primes A095071. %Y A372516 - Positions of negative ones are A372539, indices of the primes A095072. %Y A372516 - Positions of ones are A372538, indices of the primes A095073. %Y A372516 - Positions of nonnegative terms are indices of the primes A095074. %Y A372516 - Positions of nonpositive terms are indices of the primes A095075. %Y A372516 A000120 counts ones in binary expansion (binary weight), zeros A080791. %Y A372516 A030190 gives binary expansion, reversed A030308. %Y A372516 A035103 counts zeros in binary expansion of primes, firsts A372474. %Y A372516 A048793 lists binary indices, reverse A272020, sum A029931. %Y A372516 A070939 gives length of binary expansion. %Y A372516 A101211 lists run-lengths in binary expansion, row-lengths A069010. %Y A372516 A372471 lists the binary indices of each prime. %Y A372516 Cf. A000043, A003714, A005940, A059305, A061712, A066195, A071814, A211997, A372429, A372517, A372686. %K A372516 sign %O A372516 1,2 %A A372516 _Gus Wiseman_, May 13 2024