login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377421
Numbers whose binary reversal is prime and unequal to the original number.
1
6, 10, 11, 12, 13, 14, 20, 22, 23, 24, 25, 26, 28, 29, 34, 37, 40, 41, 43, 44, 46, 47, 48, 50, 52, 53, 55, 56, 58, 61, 62, 67, 68, 71, 74, 77, 80, 82, 83, 86, 88, 91, 92, 94, 96, 97, 100, 101, 104, 106, 110, 112, 113, 115, 116, 121, 122, 124, 131, 134, 136, 142
OFFSET
1,1
COMMENTS
Contains A080790 and p*2^i for all primes p in A074832 union A080790 and i > 0. - Michael S. Branicky, Oct 29 2024
LINKS
FORMULA
a = A204232 - A006995 (as sets). - Michael S. Branicky, Oct 29 2024
EXAMPLE
6 = 110_2 is a term since reversed it is 011_2 = 3 which is prime.
7 = 111_2 is not a term since base 2 palindromic numbers are not included.
MATHEMATICA
Select[Range[142], PrimeQ[r=FromDigits[Reverse[IntegerDigits[#, 2]], 2]]&&r!=#&] (* James C. McMahon, Nov 18 2024 *)
PROG
(Python)
from sympy import isprime
def ok(n): return (b:=bin(n)[2:]) != (br:=b[::-1]) and isprime(int(br, 2))
print([k for k in range(1, 143) if ok(k)]) # Michael S. Branicky, Oct 28 2024
(Python) # alternate program constructing terms directly from primes
from sympy import primerange
def auptobits(maxbits):
alst = []
for p in primerange(3, 1<<maxbits):
b = bin(p)[2:]; br = b[::-1]; t = int(br, 2)
if br != b: alst.append(t)
alst.extend(t<<i for i in range(1, maxbits-len(br)+1))
return sorted(alst)
print(auptobits(8)) # Michael S. Branicky, Oct 29 2024
CROSSREFS
Supersequence of A080790.
Sequence in context: A284302 A284350 A333410 * A107014 A206036 A349761
KEYWORD
nonn,base
AUTHOR
Simon R Blow, Oct 27 2024
STATUS
approved