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.
%I A026238 #18 Aug 25 2024 18:59:19 %S A026238 1,2,1,3,2,4,3,4,5,5,6,6,7,8,9,7,10,8,11,12,13,9,14,15,16,17,18,10,19, %T A026238 11,20,21,22,23,24,12,25,26,27,13,28,14,29,30,31,15,32,33,34,35,36,16, %U A026238 37,38,39,40,41,17,42,18,43,44,45,46,47,19 %N A026238 a(n) = j if n is the j-th prime, else a(n) = k if n is the k-th composite. %H A026238 Reinhard Zumkeller, <a href="/A026238/b026238.txt">Table of n, a(n) for n = 2..10000</a> %F A026238 a(n) = A049084(n) + A066246(n) for n >= 2. %t A026238 Table[If[PrimeQ[n],PrimePi[n],n-1-PrimePi[n]],{n,2,70}] (* _Harvey P. Dale_, Jun 06 2017 *) %o A026238 (Haskell) %o A026238 a026238 n = a049084 n + a066246 n -- _Reinhard Zumkeller_, Jan 29 2014 %o A026238 (PARI) first(n)=my(c,p); vector(n-1,k, if(isprime(k+1),p++,c++)) \\ _Charles R Greathouse IV_, Sep 02 2015 %Y A026238 Cf. A049084, A066246, A026233, A239968. %K A026238 nonn %O A026238 2,2 %A A026238 _Clark Kimberling_