login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309321 The number of primes between two consecutive palindromic primes, bounds excluded. 1
0, 0, 0, 0, 20, 5, 3, 5, 0, 21, 5, 2, 1, 52, 4, 3, 0, 17, 0, 1104, 21, 7, 73, 9, 105, 35, 8, 54, 51, 11, 34, 43, 78, 8, 52, 29, 19, 10, 80, 50, 22, 33, 78, 53, 9, 994, 11, 17, 26, 7, 20, 49, 75, 12, 109, 100, 27, 16, 12, 16, 32, 48, 28, 69, 32, 42, 6, 56, 48 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Hauke Löffler, Table of n, a(n) for n = 1..1000

FORMULA

a(n) = A075807(n+1) - A075807(n) - 1. - Jinyuan Wang, Jul 24 2019

EXAMPLE

a(0): Between the first two palindromic primes (2,3) are 0 primes.

a(6): Between 101 and 131 are 5 primes (103, 107, 109, 113, 127).

PROG

(SageMath)

#Palindromic primes

def count_primes_between(a, b):

    return len(prime_range(a+1, b))

[count_primes_between(A002385[i], A002385[i+1]) for i in range (len(A002385)-1)]

# Alternative:

def A309321list(bound):

    L = []; p = 2

    while p < bound:

        p = next_prime(p)

        delta = 0

        while not Word(p.digits()).is_palindrome():

            delta += 1

            p = next_prime(p)

        L.append(delta)

    return L

A309321list(18181) # Peter Luschny, Jul 23 2019

CROSSREFS

Cf. A002385, A037010, A075807, A176559.

Sequence in context: A018816 A040389 A040386 * A104158 A068612 A233820

Adjacent sequences:  A309318 A309319 A309320 * A309322 A309323 A309324

KEYWORD

nonn

AUTHOR

Hauke Löffler, Jul 23 2019

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 25 08:33 EST 2021. Contains 341606 sequences. (Running on oeis4.)