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!)
A014237 a(n) = (n-th prime) - (n-th nonprime). 5
1, -1, -1, -1, 2, 3, 5, 5, 8, 13, 13, 17, 20, 21, 23, 28, 33, 34, 39, 41, 41, 46, 49, 54, 61, 63, 64, 67, 67, 69, 82, 85, 89, 90, 99, 100, 105, 109, 112, 117, 122, 123, 131, 131, 134, 135, 146, 157, 159, 160, 163, 167, 167, 176, 181, 186, 191, 191, 196 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
a(n) = A000040(n) - A018252(n). - Reinhard Zumkeller, Apr 30 2014
LINKS
MATHEMATICA
nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n+PrimePi@n];
Table[Prime[n] - nonPrime[n], {n, 1, 70}] (* G. C. Greubel, Jun 22 2019 *)
PROG
(Haskell)
a014237 n = a000040 n - a018252 n -- Reinhard Zumkeller, Apr 30 2014
(Python)
from sympy import prime, composite
def A014237(n):
return 1 if n == 1 else prime(n)-composite(n-1) # Chai Wah Wu, Dec 27 2018
CROSSREFS
Sequence in context: A287919 A138181 A006447 * A033885 A053079 A326061
KEYWORD
sign
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 23 10:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)