cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A085343 Number of primes between sigma(n) and phi(n) inclusive.

Original entry on oeis.org

0, 2, 1, 3, 1, 4, 1, 4, 3, 5, 1, 7, 1, 6, 5, 7, 1, 9, 1, 9, 6, 7, 1, 13, 3, 8, 5, 11, 1, 16, 1, 12, 7, 10, 6, 19, 1, 10, 7, 18, 1, 19, 1, 15, 12, 12, 1, 24, 3, 16, 9, 16, 1, 23, 8, 21, 11, 15, 1, 33, 1, 14, 16, 20, 8, 26, 1, 19, 10, 25, 1, 35, 1, 19, 18, 23, 7, 30, 1, 31, 14, 18, 1, 39, 10, 19
Offset: 1

Views

Author

Labos Elemer, Jul 10 2003

Keywords

Comments

a(p) = 1 for prime p > 2. Since phi(p) = p - 1 and sigma(p) = p + 1, the largest prime q < p - 1 must be the prime previous to p, while p itself is the largest prime less than p + 1 for p > 2. - Michael De Vlieger, Jan 22 2020

Examples

			n=12: sigma(12)=28, phi(n)=4, Pi(28)-Pi(4)=9-2=7.
		

Crossrefs

Programs

  • Mathematica
    Array[Subtract @@ PrimePi@{DivisorSigma[1, #], EulerPhi@ #} &, 86] (* Michael De Vlieger, Jan 22 2020 *)
  • PARI
    a(n) = primepi(sigma(n)) - primepi(eulerphi(n)); \\ Michel Marcus, Aug 29 2019

Formula

a(n) = pi(sigma(n)) - pi(phi(n)) = A000720(A000203(n)) - A000720(A000010(n)).
a(n) = A070803(n) - A070804(n). - Antti Karttunen, Jan 22 2020