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.

Previous Showing 21-23 of 23 results.

A366910 Number of n-bit binary reversible primes.

Original entry on oeis.org

0, 1, 2, 2, 4, 6, 9, 14, 27, 36, 69, 94, 178, 308, 589, 908, 1540, 2814, 5158, 9210, 16732, 29392, 55109, 101120, 179654, 332130, 625928, 1136814, 2120399, 3963166, 7377931, 13878622, 25958590, 48421044, 92163237, 173672988, 325098134, 617741968, 1177573074, 2221353224, 4222570054
Offset: 1

Views

Author

Cathy Swaenepoel, Oct 27 2023

Keywords

Comments

Number of primes p in [2^(n-1),2^n) whose reverse in base 2 is also prime. The count includes palindromic primes in base 2.

Examples

			The 5-bit binary reversible primes are 17="10001", 23="10111", 29="11101" and 31="11111", so a(5)=4.
		

Crossrefs

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

A226035 Prime powers (A025475) whose decimal digit reversal is also a prime power.

Original entry on oeis.org

1, 4, 8, 9, 121, 169, 343, 961, 1331, 10201, 12769, 14641, 94249, 96721, 1030301, 1042441, 1062961, 1216609, 1442401, 1692601, 9066121, 104060401, 121066009, 900660121, 12148668841, 12367886521, 12568876321, 14886684121, 1000422044521, 1002007006009, 1020506060401
Offset: 1

Views

Author

Alex Ratushnyak, May 24 2013

Keywords

Crossrefs

Previous Showing 21-23 of 23 results.