login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065890 Number of composites less than the n-th prime. 8
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
First differences form A046933, which requires that for this sequence the parity of successive terms alternates.
LINKS
FORMULA
a(n) = A000040(n)-n-1 = A014689(n)-1 = A014692(n)-2.
EXAMPLE
p = p(25) = 97 is the 25th prime,p-1 = 96 is the 71st composite number in A002808; it is also the 72nd nonprime in A018252; A065890(n) = composite [in A002808] index of p(n)-1; A014689(n) = composite [in A002808] index of p(n)+1; A014689(n) = nonprime [in A018252] index of p(n)-1; A014692(n) = nonprime [in A018252] index of p(n)+1.
MATHEMATICA
CompositePi[n_Integer] := (n - PrimePi[n] - 1); Table[ CompositePi[ Prime[n]], {n, 1, 75} ]
PROG
(PARI) { for (n=1, 1000, p=prime(n); a=p - primepi(p) - 1; write("b065890.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 03 2009
(Magma) [NthPrime(n)-n-1: n in [1..65]]; // Vincenzo Librandi, Aug 15 2015
CROSSREFS
Sequence in context: A187583 A000277 A003664 * A162177 A213730 A191172
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 29 23:45 EDT 2024. Contains 372114 sequences. (Running on oeis4.)