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 A007821 #73 Oct 20 2024 03:54:11 %S A007821 2,7,13,19,23,29,37,43,47,53,61,71,73,79,89,97,101,103,107,113,131, %T A007821 137,139,149,151,163,167,173,181,193,197,199,223,227,229,233,239,251, %U A007821 257,263,269,271,281,293,307,311,313,317,337,347,349,359,373 %N A007821 Primes p such that pi(p) is not prime. %C A007821 Primes prime(k) such that A049076(k)=1, sorted along increasing k. - _R. J. Mathar_, Jan 28 2014 %C A007821 The complement of A006450 (primes with prime index) within the primes A000040. %D A007821 C. Kimberling, Fractal sequences and interspersions, Ars Combinatoria, vol. 45 p 157 1997. %H A007821 R. Zumkeller, <a href="/A007821/b007821.txt">Table of n, a(n) for n = 1..1000</a> %H A007821 Lubomir Alexandrov, <a href="http://arxiv.org/abs/math/9811096">On the nonasymptotic prime number distribution</a>, arXiv:math/9811096 [math.NT], 1998. %H A007821 N. Fernandez, <a href="http://www.borve.org/primeness/FOP.html">An order of primeness, F(p)</a> %H A007821 N. Fernandez, <a href="/A006450/a006450.html">An order of primeness</a> [cached copy, included with permission of the author] %F A007821 A137588(a(n)) = n; a(n) = A000040(A018252(n)). - _Reinhard Zumkeller_, Jan 28 2008 %F A007821 A000040 = A007821 U A006450. - _Juri-Stepan Gerasimov_, Sep 24 2009 %F A007821 A175247 U { a(n); n > 1 } = A000040. { a(n) } = { 2 } U { primes (A000040) with composite index (A002808) }. - _Jaroslav Krizek_, Mar 13 2010 %F A007821 G.f. over nonprime powers: Sum_{k >= 1} prime(k)*x^k-prime(prime(k))*x^prime(k). - _Benedict W. J. Irwin_, Jun 11 2016 %p A007821 A007821 := proc(n) ithprime(A018252(n)) ; end proc: # _R. J. Mathar_, Jul 07 2012 %t A007821 Prime[ Select[ Range[75], !PrimeQ[ # ] &]] (* _Robert G. Wilson v_, Mar 15 2004 *) %t A007821 With[{nn=100},Pick[Prime[Range[nn]],Table[If[PrimeQ[n],0,1],{n,nn}],1]] (* _Harvey P. Dale_, Aug 14 2020 *) %o A007821 (Haskell) %o A007821 a007821 = a000040 . a018252 %o A007821 a007821_list = map a000040 a018252_list %o A007821 -- _Reinhard Zumkeller_, Jan 12 2013 %o A007821 (PARI) forprime(p=2, 1e3, if(!isprime(primepi(p)), print1(p, ", "))) \\ _Felix Fröhlich_, Aug 16 2014 %o A007821 (Python) %o A007821 from sympy import primepi %o A007821 def A007821(n): %o A007821 def bisection(f,kmin=0,kmax=1): %o A007821 while f(kmax) > kmax: kmax <<= 1 %o A007821 while kmax-kmin > 1: %o A007821 kmid = kmax+kmin>>1 %o A007821 if f(kmid) <= kmid: %o A007821 kmax = kmid %o A007821 else: %o A007821 kmin = kmid %o A007821 return kmax %o A007821 def f(x): return n+x-(p:=primepi(x))+primepi(p) %o A007821 return bisection(f,n,n) # _Chai Wah Wu_, Oct 19 2024 %Y A007821 Cf. A049076, A049078, A049079, A049080, A049081, A058322, A058324, A058325, A058326, A058327, A058328, A093046, A006450. %Y A007821 Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270795, A270796, A102616. %K A007821 nonn %O A007821 1,1 %A A007821 Monte J. Zerger (mzerger(AT)cc4.adams.edu), _Clark Kimberling_ %E A007821 Edited by _M. F. Hasler_, Jul 31 2015