login
A372685
Prime numbers such that no lesser prime has the same binary weight (number of ones in binary expansion).
3
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,1
COMMENTS
The unsorted version is A061712.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..3320 (terms 36..3320 using A061712)
FORMULA
a(n) = prime(A372686(n)).
EXAMPLE
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}
MATHEMATICA
First/@GatherBy[Select[Range[1000], PrimeQ], DigitCount[#, 2, 1]&]
PROG
(Python)
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
CROSSREFS
This statistic (binary weight of primes) is A014499.
Sorted version of A061712.
For binary length instead of weight we have A104080, firsts of A035100.
These primes have indices A372686, sorted version of A372517.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A029837 gives greatest binary index, least A001511.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A372471 lists binary indices of primes.
Sequence in context: A236514 A211997 A127581 * A278477 A118883 A061712
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, May 10 2024
EXTENSIONS
a(22)-a(33) from Chai Wah Wu, May 12 2024
STATUS
approved