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

A085655
Difference between number of primes not exceeding reversed n and n.
1
0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 3, 5, 7, 9, 12, 13, 15, 16, -7, -3, 0, 2, 4, 6, 9, 11, 13, 14, -8, -5, -2, 0, 3, 5, 7, 9, 11, 12, -10, -7, -4, -3, 0, 2, 4, 6, 8, 9, -12, -9, -6, -5, -2, 0, 2, 5, 7, 7, -14, -12, -9, -7, -4, -2, 0, 2, 4, 5, -15, -13, -11, -9, -6, -5, -2, 0, 2, 3, -18, -15, -13, -11, -8, -7, -4, -2, 0, 1, -20, -16, -14, -12, -9, -7
OFFSET
1,10
LINKS
FORMULA
a(n) = pi(rev(n)) - pi(n).
a(n) = 0 for palindromic numbers.
MATHEMATICA
Array[Subtract @@ PrimePi@ {IntegerReverse @#, #} &, 95] (* Michael De Vlieger, Mar 27 2020 *)
PROG
(PARI) a(n) = primepi(fromdigits(Vecrev(digits(n)))) - primepi(n); \\ Michel Marcus, Mar 27 2020
CROSSREFS
KEYWORD
base,sign
AUTHOR
Labos Elemer, Jul 10 2003
STATUS
approved