login
A262558
Number of palindromic primes <= n.
1
0, 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6
OFFSET
0,4
COMMENTS
More than the usual number of terms are displayed in order to show the first 6.
LINKS
EXAMPLE
The sixth palindromic prime is 101, so a(101)=6.
MAPLE
# SEQPI: produces the pi function for a monotonic sequence a[]
# Returns list b[], where b[n+1} gives number of terms in range 0 to n.
# Generates at least M terms of b (if possible) and then stops at the next convenient stopping point.
SEQPI:=proc(a, M) local b, la, L, i, s, at, ct, h:
if whattype(a) <> list then RETURN([]); fi:
la:=nops(a); b:=[]: L:=min(a[la], M);
ct:=0;
s:=0;
for at from 1 to la do
for i from s to a[at]-1 do b:=[op(b), ct]; od:
ct:=ct+1;
s:=a[at];
if s>L then break; fi;
od:
b:=[op(b), ct];
RETURN(b);
end;
# Assume b2385 has the first 1000 terms of A002385
SEQPI(b2385, 20000):
MATHEMATICA
Accumulate[Table[If[PrimeQ[n]&&PalindromeQ[n], 1, 0], {n, 0, 200}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 29 2017 *)
CROSSREFS
Cf. A002113 (palindromes), A002385 (palindromic primes).
Sequence in context: A341167 A094235 A328003 * A156876 A137397 A239684
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Oct 15 2015
STATUS
approved