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.

A377421 Numbers whose binary reversal is prime and unequal to the original number.

Original entry on oeis.org

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

Views

Author

Simon R Blow, Oct 27 2024

Keywords

Comments

Contains A080790 and p*2^i for all primes p in A074832 union A080790 and i > 0. - Michael S. Branicky, Oct 29 2024

Examples

			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.
		

Crossrefs

Supersequence of A080790.

Programs

  • Mathematica
    Select[Range[142],PrimeQ[r=FromDigits[Reverse[IntegerDigits[#,2]],2]]&&r!=#&] (* James C. McMahon, Nov 18 2024 *)
  • 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<Michael S. Branicky, Oct 29 2024

Formula

a = A204232 - A006995 (as sets). - Michael S. Branicky, Oct 29 2024