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”).

Number of primes up to n-th palindromic number.
1

%I #10 Jun 14 2024 04:14:11

%S 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,

%T 42,43,46,47,47,50,53,54,55,58,60,61,62,65,66,67,68,71,72,74,76,77,79,

%U 80,82,84,86,87,90,91,92,94,96,97,99,99,100,101,103,105,106,108,110,112

%N Number of primes up to n-th palindromic number.

%F a(n) = A000720(A002113(n)). - _Michel Marcus_, Jun 14 2024

%e a(11)=8 because there are 8 primes up to 11th palindromic number (i.e. 22).

%o (Python)

%o from sympy import primepi

%o def A076890(n):

%o if n == 1: return 0

%o y = 10*(x:=10**(len(str(n+1>>1))-1))

%o 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

%Y Cf. A000720, A002113.

%K base,nonn

%O 1,3

%A _Shyam Sunder Gupta_, Nov 25 2002