A372685 Prime numbers such that no lesser prime has the same binary weight (number of ones in binary expansion).
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
Examples
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}
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..3320 (terms 36..3320 using A061712)
Crossrefs
Programs
-
Mathematica
First/@GatherBy[Select[Range[1000],PrimeQ],DigitCount[#,2,1]&]
-
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
Formula
a(n) = prime(A372686(n)).
Extensions
a(22)-a(33) from Chai Wah Wu, May 12 2024
Comments