A372539
Numbers k such that the number of ones minus the number of zeros in the binary expansion of the k-th prime number is -1.
Original entry on oeis.org
7, 19, 21, 25, 56, 57, 59, 60, 62, 68, 71, 77, 79, 87, 175, 177, 179, 180, 186, 188, 189, 192, 193, 195, 196, 197, 204, 210, 212, 216, 218, 243, 244, 248, 254, 262, 263, 265, 279, 567, 572, 576, 577, 583, 592, 598, 599, 600, 602, 603, 605, 606, 610, 613, 616
Offset: 1
The binary expansion of 17 is (1,0,0,0,1) with ones minus zeros 2 - 3 = -1, and 17 is the 7th prime, 7 is in the sequence.
The primes A000040(a(n)) together with their binary expansions and binary indices begin:
17: 10001 ~ {1,5}
67: 1000011 ~ {1,2,7}
73: 1001001 ~ {1,4,7}
97: 1100001 ~ {1,6,7}
263: 100000111 ~ {1,2,3,9}
269: 100001101 ~ {1,3,4,9}
277: 100010101 ~ {1,3,5,9}
281: 100011001 ~ {1,4,5,9}
293: 100100101 ~ {1,3,6,9}
337: 101010001 ~ {1,5,7,9}
353: 101100001 ~ {1,6,7,9}
389: 110000101 ~ {1,3,8,9}
401: 110010001 ~ {1,5,8,9}
449: 111000001 ~ {1,7,8,9}
1039: 10000001111 ~ {1,2,3,4,11}
1051: 10000011011 ~ {1,2,4,5,11}
1063: 10000100111 ~ {1,2,3,6,11}
1069: 10000101101 ~ {1,3,4,6,11}
1109: 10001010101 ~ {1,3,5,7,11}
1123: 10001100011 ~ {1,2,6,7,11}
1129: 10001101001 ~ {1,4,6,7,11}
1163: 10010001011 ~ {1,2,4,8,11}
A000120 counts ones in binary expansion (binary weight), zeros
A080791.
A070939 gives the length of an integer's binary expansion.
A372471 lists binary indices of primes.
Cf.
A003714,
A031448,
A035100,
A037861,
A053738,
A061712,
A066195,
A104080,
A211997,
A372429,
A372517,
A372686.
-
Select[Range[1000],DigitCount[Prime[#],2,1]-DigitCount[Prime[#],2,0]==-1&]
A372685
Prime numbers such that no lesser prime has the same binary weight (number of ones in binary expansion).
Original entry on oeis.org
2, 3, 7, 23, 31, 127, 311, 383, 991, 2039, 3583, 6143, 8191, 63487, 73727, 129023, 131071, 522239, 524287, 1966079, 4128767, 14680063, 16250879, 33546239, 67108351, 201064447, 260046847, 536739839, 1073479679, 2147483647, 5335154687, 8581545983, 16911433727
Offset: 1
The terms together with their binary expansions and binary indices begin:
2: 10 ~ {2}
3: 11 ~ {1,2}
7: 111 ~ {1,2,3}
23: 10111 ~ {1,2,3,5}
31: 11111 ~ {1,2,3,4,5}
127: 1111111 ~ {1,2,3,4,5,6,7}
311: 100110111 ~ {1,2,3,5,6,9}
383: 101111111 ~ {1,2,3,4,5,6,7,9}
991: 1111011111 ~ {1,2,3,4,5,7,8,9,10}
2039: 11111110111 ~ {1,2,3,5,6,7,8,9,10,11}
3583: 110111111111 ~ {1,2,3,4,5,6,7,8,9,11,12}
6143: 1011111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,13}
This statistic (binary weight of primes) is
A014499.
For binary length instead of weight we have
A104080, firsts of
A035100.
A000120 counts ones in binary expansion (binary weight), zeros
A080791.
A372471 lists binary indices of primes.
-
First/@GatherBy[Select[Range[1000],PrimeQ],DigitCount[#,2,1]&]
-
from itertools import islice
from sympy import nextprime
def A372685_gen(): # generator of terms
p, a = 1, {}
while (p:=nextprime(p)):
if (c:=p.bit_count()) not in a:
yield p
a[c] = p
A372685_list = list(islice(A372685_gen(),20)) # Chai Wah Wu, May 12 2024
Comments