OFFSET
1,3
FORMULA
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
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Nov 25 2002
STATUS
approved