A309321 The number of primes between two consecutive palindromic primes, bounds excluded.
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
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).
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Hauke Löffler)
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