login
A074831
Number of binary reversal primes less than 10^n.
1
3, 20, 101, 508, 3053, 20053, 141772, 1045600, 8038954, 63830588, 518935134, 4311185894
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
Kevin S. Brown's Mathpages, Reflective and Cyclic Sets of Primes
Cécile Dartyge, Bruno Martin, Joël Rivat, Igor E. Shparlinski, and Cathy Swaenepoel, Reversible primes, arXiv:2309.11380 [math.NT], 2023. See p. 34.
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
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