login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014237 a(n) = (n-th prime) - (n-th nonprime). 4
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

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

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

Cf. A038529, A026233, A127118.

Sequence in context: A287919 A138181 A006447 * A033885 A053079 A326061

Adjacent sequences:  A014234 A014235 A014236 * A014238 A014239 A014240

KEYWORD

sign

AUTHOR

Clark Kimberling

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 20 07:48 EDT 2019. Contains 326143 sequences. (Running on oeis4.)