[go: up one dir, main page]

login
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