login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050251 Number of palindromic primes less than 10^n. 4
4, 5, 20, 20, 113, 113, 781, 781, 5953, 5953, 47995, 47995, 401696, 401696, 3438339, 3438339, 30483565, 30483565, 269577430, 269577430, 2427668363, 2427668363, 22170468927, 22170468927 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Every palindrome with an even number of digits is divisible by 11 and therefore is composite (not prime). Hence there is only one palindromic prime with an even number of digits, 11. - Martin Renner, Apr 15 2006

LINKS

Table of n, a(n) for n=0..23.

P. De Geest, World!Of Palindromic Primes, Page 1

Shyam Sunder Gupta, Palindromic Primes up to 10^19.

Shyam Sunder Gupta, Palindromic Primes up to 10^23.

Eric Weisstein's World of Mathematics, Palindromic Prime.

Index entries for sequences related to numbers of primes in various ranges

FORMULA

a(n) ~ A070199(n)/log(10^n) = 1/log(10^n)*Sum {k=1..n} 9*10^floor[(k-1)/2]. - Robert G. Wilson v, May 31 2009

PROG

(Python)

from __future__ import division

from sympy import isprime

def paloddgen(l, b=10): # generator of odd-length palindromes in base b of length <= 2*l

....if l > 0:

........yield 0

........for x in range(1, l+1):

............n = b**(x-1)

............n2 = n*b

............for y in range(n, n2):

................k, m = y//b, 0

................while k >= b:

....................k, r = divmod(k, b)

....................m = b*m + r

................yield y*n + b*m + k

def A050251(n):

....if n == 0:

........return 4

....else:

........c = 1

........for i in paloddgen(n//2+1):

............if isprime(i):

................c += 1

........return c # Chai Wah Wu, Jan 05 2015

CROSSREFS

Partial sums of A016115.

Cf. A002113 (palindromes), A002385 (palindromic primes).

Sequence in context: A042835 A193964 A099897 * A125995 A080610 A047175

Adjacent sequences:  A050248 A050249 A050250 * A050252 A050253 A050254

KEYWORD

nonn,hard,nice,base,more

AUTHOR

Eric W. Weisstein

EXTENSIONS

More terms from Patrick De Geest, Aug 01 1999

2 more terms from Shyam Sunder Gupta, Feb 12 2006

2 more terms from Shyam Sunder Gupta, Mar 13 2009

a(22)-a(23) from Shyam Sunder Gupta, Oct 05 2013

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified December 15 03:08 EST 2017. Contains 296020 sequences.