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.

A065890 Number of composites less than the n-th prime.

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 9, 10, 13, 18, 19, 24, 27, 28, 31, 36, 41, 42, 47, 50, 51, 56, 59, 64, 71, 74, 75, 78, 79, 82, 95, 98, 103, 104, 113, 114, 119, 124, 127, 132, 137, 138, 147, 148, 151, 152, 163, 174, 177, 178, 181, 186, 187, 196, 201, 206, 211, 212, 217, 220, 221
Offset: 1

Views

Author

Labos Elemer and Robert G. Wilson v, Nov 28 2001

Keywords

Comments

First differences form A046933, which requires that for this sequence the parity of successive terms alternates.

Examples

			a(25) = 71 since prime(25) = 97 is the 25th prime and 96 is the 71st composite number in A002808.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)-n-1: n in [1..65]]; // Vincenzo Librandi, Aug 15 2015
    
  • Mathematica
    CompositePi[n_Integer] := (n - PrimePi[n] - 1); Table[ CompositePi[ Prime[n]], {n, 1, 75} ]
  • PARI
    a(n) = { prime(n) - n - 1 } \\ Harry J. Smith, Nov 03 2009
    
  • Python
    from sympy import prime
    def A065890(n): return prime(n)-n-1 # Chai Wah Wu, Oct 11 2024

Formula

a(n) = A065855(A000040(n)).
a(n) = A000040(n)-n-1 = A014689(n)-1 = A014692(n)-2.