close
login
A065890
Number of composites less than the n-th prime.
49
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,4
COMMENTS
First differences form A046933, which requires that for this sequence the parity of successive terms alternates.
LINKS
FORMULA
a(n) = A065855(A000040(n)).
a(n) = A000040(n)-n-1 = A014689(n)-1 = A014692(n)-2.
EXAMPLE
a(25) = 71 since prime(25) = 97 is the 25th prime and 96 is the 71st composite number in A002808.
MATHEMATICA
CompositePi[n_Integer] := (n - PrimePi[n] - 1); Table[ CompositePi[ Prime[n]], {n, 1, 75} ]
PROG
(PARI) a(n) = { prime(n) - n - 1 } \\ Harry J. Smith, Nov 03 2009
(Magma) [NthPrime(n)-n-1: n in [1..65]]; // Vincenzo Librandi, Aug 15 2015
(Python)
from sympy import prime
def A065890(n): return prime(n)-n-1 # Chai Wah Wu, Oct 11 2024
KEYWORD
nonn
AUTHOR
STATUS
approved