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.

A376762 Number of composite numbers c in the range prime(n) < c <= 2*prime(n+1).

Original entry on oeis.org

2, 5, 6, 11, 11, 16, 16, 21, 28, 25, 33, 35, 35, 41, 47, 51, 50, 59, 60, 61, 69, 71, 78, 85, 84, 85, 91, 92, 98, 117, 111, 117, 115, 131, 126, 134, 140, 142, 150, 154, 152, 168, 162, 168, 168, 187, 196, 192, 192, 197, 205, 203, 219, 220, 225, 232, 230, 240, 242, 242, 258, 271, 264, 265, 271, 290, 288, 300, 295, 301, 309, 317, 320, 325, 327, 334, 344, 344, 355, 364, 358
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2024

Keywords

Examples

			a(2) = 5 because there are 5 composite numbers c in the range 3 < c <= 10, namely 4, 6, 8, 9, and 10.
		

Crossrefs

Programs

  • Mathematica
    A376762[n_] := n - Prime[n] + 2*Prime[n+1] - PrimePi[2*Prime[n+1]];
    Array[A376762, 100] (* Paolo Xausa, Oct 29 2024 *)
  • Python
    from sympy import prime, nextprime, primepi
    def A376762(n): return int(n-(p:=prime(n))+(q:=nextprime(p)<<1)-primepi(q)) # Chai Wah Wu, Oct 29 2024

Formula

a(n) = 2*q - pi(2*q) - p + n, where p = prime(n), q = prime(n+1), and pi() = A000720().
a(n) = A210497(n) - A020900(n+1) + n. - Paolo Xausa, Oct 29 2024