Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Sep 19 2019 03:58:22
%S 0,1,2,2,3,3,4,4,4,5,8,11,55,66,77,99,99,101,121,141,151,161,303,525,
%T 757,797,1551,2222,4114,4334,4884,5995,6336,8008,9119,9229,22222,
%U 33433,48684,53735,54645,55555,56465,61316,64046,72027,72727,84548,89998
%N Palindromes q derived from palindromes p such that pi(p) = q.
%H Giovanni Resta, <a href="/A103358/b103358.txt">Table of n, a(n) for n = 1..196</a>
%t NextPalindrome[n_] := Block[ {l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[ idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] FromDigits[ Take[ idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[ idn, Ceiling[l/2]], Reverse[ Take[ idn, Floor[l/2]]] ]], idfhn = FromDigits[ Take[ idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]] ]]]];
%t p = 0; a = {}; Do[p = NextPalindrome[ p]; q = IntegerDigits[ PrimePi[ p]]; If[ Reverse[q] == q, Print[{p, FromDigits[q]}]; AppendTo[a, p]], {n, 10^4}]; PrimePi[a] (* _Robert G. Wilson v_, Feb 03 2005 *)
%Y Equals pi(A103357).
%Y Cf. A046941, A046942, A103357, A103402, A103403.
%K base,nonn
%O 1,3
%A _Zak Seidov_, Feb 02 2005
%E More terms from _Robert G. Wilson v_, Feb 03 2005