login
A014237
a(n) = (n-th prime) - (n-th nonprime).
6
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
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
KEYWORD
sign
STATUS
approved