The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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

%I #12 Jun 22 2019 23:13:43

%S 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,

%T 63,64,67,67,69,82,85,89,90,99,100,105,109,112,117,122,123,131,131,

%U 134,135,146,157,159,160,163,167,167,176,181,186,191,191,196

%N a(n) = (n-th prime) - (n-th nonprime).

%C a(n) = A000040(n) - A018252(n). - _Reinhard Zumkeller_, Apr 30 2014

%H Reinhard Zumkeller, <a href="/A014237/b014237.txt">Table of n, a(n) for n = 1..10000</a>

%t nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n+PrimePi@n];

%t Table[Prime[n] - nonPrime[n], {n, 1, 70}] (* _G. C. Greubel_, Jun 22 2019 *)

%o (Haskell)

%o a014237 n = a000040 n - a018252 n -- _Reinhard Zumkeller_, Apr 30 2014

%o (Python)

%o from sympy import prime, composite

%o def A014237(n):

%o return 1 if n == 1 else prime(n)-composite(n-1) # _Chai Wah Wu_, Dec 27 2018

%Y Cf. A038529, A026233, A127118.

%K sign

%O 1,5

%A _Clark Kimberling_

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 May 16 08:41 EDT 2024. Contains 372552 sequences. (Running on oeis4.)