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.

A048054 Number of n-digit reversible primes (emirps).

Original entry on oeis.org

4, 9, 43, 204, 1499, 9538, 71142, 535578, 4197196, 33619380, 274932272, 2294771254, 19489886063, 167630912672, 1456476399463
Offset: 1

Views

Author

Keywords

Comments

The count includes palindromes.

Examples

			2, 3, 5 and 7 are 1-digit reversible primes, so a(1)=4.
		

Crossrefs

Programs

  • Mathematica
    Count[Range[10^(# - 1), 10^# - 1], n_ /; And[PrimeQ@ n, PrimeQ@ FromDigits@ Reverse@ IntegerDigits@ n]] & /@ Range@ 7 (* Michael De Vlieger, Jul 14 2015 *)
  • Python
    from sympy import isprime, primerange
    def A048054(n):
        return len([p for p in primerange(10**(n-1),10**n)
                    if isprime(int(str(p)[::-1]))]) # Chai Wah Wu, Aug 14 2014

Extensions

a(11)-a(13) from Giovanni Resta, Jul 19 2015
a(14)-a(15) from Cécile Dartyge, Bruno Martin, Joël Rivat, Igor E. Shparlinski, and Cathy Swaenepoel, Oct 05 2023