login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A076890
Number of primes up to n-th palindromic number.
1
0, 1, 2, 2, 3, 3, 4, 4, 4, 5, 8, 11, 14, 16, 18, 21, 23, 25, 26, 29, 30, 32, 34, 36, 37, 39, 42, 43, 46, 47, 47, 50, 53, 54, 55, 58, 60, 61, 62, 65, 66, 67, 68, 71, 72, 74, 76, 77, 79, 80, 82, 84, 86, 87, 90, 91, 92, 94, 96, 97, 99, 99, 100, 101, 103, 105, 106, 108, 110, 112
OFFSET
1,3
FORMULA
a(n) = A000720(A002113(n)). - Michel Marcus, Jun 14 2024
EXAMPLE
a(11)=8 because there are 8 primes up to 11th palindromic number (i.e. 22).
PROG
(Python)
from sympy import primepi
def A076890(n):
if n == 1: return 0
y = 10*(x:=10**(len(str(n+1>>1))-1))
return primepi((c:=n+1-x)*x+int(str(c)[-2::-1]or 0) if n<x+y else (c:=n+1-y)*y+int(str(c)[-1::-1]or 0)) # Chai Wah Wu, Jun 14 2024
CROSSREFS
Sequence in context: A028825 A326492 A132924 * A103358 A063084 A127079
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Nov 25 2002
STATUS
approved