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.

A309321 The number of primes between two consecutive palindromic primes, bounds excluded.

Original entry on oeis.org

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
Offset: 1

Views

Author

Hauke Löffler, Jul 23 2019

Keywords

Examples

			a(0): Between the first two palindromic primes (2,3) there are 0 primes.
a(6): Between 101 and 131 there are 5 primes (103, 107, 109, 113, 127).
		

Crossrefs

Programs

  • 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

Formula

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