OFFSET
1,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..196 (terms < 10^16)
FORMULA
a(n) = P_A103358(n).
MATHEMATICA
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]]]] ]]]];
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}]; a (* Robert G. Wilson v, Feb 03 2005 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov, Feb 02 2005
EXTENSIONS
More terms from Robert G. Wilson v, Feb 03 2005
STATUS
approved