OFFSET
1,1
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..6542
EXAMPLE
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
MATHEMATICA
SortBy[Select[Range[2^9], PrimeQ], IntegerReverse[#, 2] &] (* Amiram Eldar, Feb 15 2022 *)
PROG
(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)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 13 2022
STATUS
approved