A351528 Prime numbers ordered by their binary reversal.
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
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..6542
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
Comments