login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A074831 Number of binary reversal primes less than 10^n. 0
3, 20, 101, 508, 3053, 20053, 141772, 1045600, 8038954, 63830588, 518935134, 4311185894 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

MathPages counts 1 as being a binary reversal prime whereas the title would exclude it, therefore their count exceeds this count by one.

LINKS

Table of n, a(n) for n=1..12.

MathPages, Reflective and Cyclic Sets of Primes

MATHEMATICA

f[n_] := FromDigits[Reverse[IntegerDigits[n, 2]], 2]; NextPrim[n_] := Block[{k = n + 1}, While[ ! PrimeQ[k], k++ ]; k]; c = 0; k = 1; Do[ While[k = NextPrim[k]; k < 10^n, If[ PrimeQ[ f[k]], c++ ]]; k--; Print[c], {n, 16}]

PROG

(Python)

from sympy import isprime, primerange

def is_bin_rev_prime(n): return isprime(int(bin(n)[2:][::-1], 2))

def a(n): return sum(is_bin_rev_prime(p) for p in primerange(1, 10**n))

print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Mar 20 2021

CROSSREFS

Sequence in context: A305203 A246150 A000948 * A203357 A304494 A000917

Adjacent sequences:  A074828 A074829 A074830 * A074832 A074833 A074834

KEYWORD

nonn,base,hard,more

AUTHOR

Robert G. Wilson v, Sep 09 2002

EXTENSIONS

a(10)-a(11) from Chai Wah Wu, Oct 09 2018

a(12) from Chai Wah Wu, Oct 10 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 28 14:34 EDT 2022. Contains 354115 sequences. (Running on oeis4.)