%I #16 Sep 12 2019 01:55:18
%S 3,4,5,6,11,33,555,878,5775,6116,919919,58633685,129707921,
%T 16958285961,867275572768,50166722766105,310439747934013,
%U 4384495885944834,5817988338897185
%N Palindromes p such that pi(p) is a palindromic prime.
%C From a suggestion from _Zak Seidov_, Feb 02 2005.
%C a(16) > 32*10^12. - _Donovan Johnson_, Dec 03 2009
%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 = PrimePi[p]; If[PrimeQ[q], r = IntegerDigits[q]; If[Reverse[r] == r, Print[{p, q}]; AppendTo[a, p]]], {n, 10^6}]; a
%t palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {}; Do[If[palQ[n] && PrimeQ[x = PrimePi[n]] && palQ[x], AppendTo[t, n]], {n,10^6}]; t (* _Jayanta Basu_, Jun 24 2013 *)
%Y Cf. A046941, A046942, A103357, A103358, A103403.
%K nonn,base,more
%O 1,1
%A _Robert G. Wilson v_, Feb 03 2005
%E a(15) from _Donovan Johnson_, Dec 03 2009
%E a(16)-a(17) from _Chai Wah Wu_, Sep 04 2019
%E a(18)-a(19) from _Giovanni Resta_, Sep 12 2019
|