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.

Showing 1-1 of 1 results.

A351528 Prime numbers ordered by their binary reversal.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 29, 19, 23, 31, 41, 37, 53, 61, 43, 59, 47, 97, 113, 73, 89, 101, 109, 67, 83, 107, 71, 103, 79, 127, 193, 241, 137, 233, 197, 229, 149, 181, 173, 157, 131, 163, 227, 211, 179, 139, 251, 199, 167, 151, 239, 223, 191, 257, 449, 353, 401
Offset: 1

Views

Author

Rémy Sigrist, Feb 13 2022

Keywords

Comments

See A104154 for the base-10 variant.
Mersenne primes (A000668) and Fermat primes (A019434) appear at their natural position.

Examples

			The first terms, alongside their binary and reverse binary expansions, are:
  n   a(n)  bin(a(n))  bin(rev(a(n)))
  --  ----  ---------  --------------
   1     2         10               1
   2     3         11              11
   3     5        101             101
   4     7        111             111
   5    13       1101            1011
   6    11       1011            1101
   7    17      10001           10001
   8    29      11101           10111
   9    19      10011           11001
  10    23      10111           11101
  11    31      11111           11111
		

Crossrefs

Programs

  • Mathematica
    SortBy[Select[Range[2^9], PrimeQ], IntegerReverse[#, 2] &] (* Amiram Eldar, Feb 15 2022 *)
  • PARI
    rev(n) = fromdigits(Vecrev(binary(n)), 2)
    print (vecsort(primes([1, 2^9]), (p,q)->rev(p)-rev(q))[1..58])
    
  • Python
    from itertools import count, islice
    from sympy import primerange
    def A351528_gen(): # generator of terms
        yield from (int(d[::-1],2) for l in count(1) for d in sorted(bin(m)[:1:-1] for m in primerange(2**(l-1),2**l)))
    A351528_list = list(islice(A351528_gen(),20)) # Chai Wah Wu, Feb 17 2022
Showing 1-1 of 1 results.