cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A014237 a(n) = (n-th prime) - (n-th nonprime).

This page as a plain text file.
%I A014237 #12 Jun 22 2019 23:13:43
%S A014237 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 A014237 63,64,67,67,69,82,85,89,90,99,100,105,109,112,117,122,123,131,131,
%U A014237 134,135,146,157,159,160,163,167,167,176,181,186,191,191,196
%N A014237 a(n) = (n-th prime) - (n-th nonprime).
%C A014237 a(n) = A000040(n) - A018252(n). - _Reinhard Zumkeller_, Apr 30 2014
%H A014237 Reinhard Zumkeller, <a href="/A014237/b014237.txt">Table of n, a(n) for n = 1..10000</a>
%t A014237 nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n+PrimePi@n];
%t A014237 Table[Prime[n] - nonPrime[n], {n, 1, 70}] (* _G. C. Greubel_, Jun 22 2019 *)
%o A014237 (Haskell)
%o A014237 a014237 n = a000040 n - a018252 n  -- _Reinhard Zumkeller_, Apr 30 2014
%o A014237 (Python)
%o A014237 from sympy import prime, composite
%o A014237 def A014237(n):
%o A014237     return 1 if n == 1 else prime(n)-composite(n-1) # _Chai Wah Wu_, Dec 27 2018
%Y A014237 Cf. A038529, A026233, A127118.
%K A014237 sign
%O A014237 1,5
%A A014237 _Clark Kimberling_