A065890 Number of composites less than the n-th prime.
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
Keywords
Examples
a(25) = 71 since prime(25) = 97 is the 25th prime and 96 is the 71st composite number in A002808.
Links
- Harry J. Smith, Table of n, a(n) for n=1..1000
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
Comments