cp's OEIS Frontend

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.

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

Views

Author

Gus Wiseman, May 10 2024

Keywords

Comments

The unsorted version is A061712.

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}
		

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.

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