%I M2477 #176 Sep 08 2022 08:44:34
%S 3,5,11,17,31,41,59,67,83,109,127,157,179,191,211,241,277,283,331,353,
%T 367,401,431,461,509,547,563,587,599,617,709,739,773,797,859,877,919,
%U 967,991,1031,1063,1087,1153,1171,1201,1217,1297,1409,1433,1447,1471
%N Prime-indexed primes: primes with prime subscripts.
%C A000040 = A006450 U A007821. - _Juri-Stepan Gerasimov_, Sep 24 2009
%C Subsequence of A175247 (primes (A000040) with noncomposite (A008578) subscripts), a(n) = A175247(n+1). - _Jaroslav Krizek_, Mar 13 2010
%C Primes p such that p and pi(p) are both primes. - _Juri-Stepan Gerasimov_, Jul 14 2011
%C Sum_{n>=1} 1/a(n) converges. In fact, Sum_{n>N} 1/a(n) < 1/log(N), by the integral test. - _Jonathan Sondow_, Jul 11 2012
%C The number of such primes not exceeding x > 0 is pi(pi(x)). I conjecture that the sequence a(n)^(1/n) (n = 1,2,3,...) is strictly decreasing. This is an analog of the Firoozbakht conjecture on primes. - _Zhi-Wei Sun_, Aug 17 2015
%C Limit_{n->infinity} a(n)/(n*(log(n))^2) = 1. Proof: By Cipolla's asymptotic formula, prime(n) ~ L(n) + R(n), where L(n)/n = log(n) + log(log(n)) - 1 and R(n)/n decreases logarithmically to 0. Hence, for large n, a(n) = prime(prime(n)) ~ L(L(n)+R(n)) + R(L(n)+R(n)) = n*(log(n))^2 + r(n), where r(n) grows as O(n*log(n)*log(log(n))). The rest of the proof is trivial. The convergence is very slow: for k = 1,2,3,4,5,6, sqrt(a(10^k)/10^k)/log(10^k) evaluates to 2.055, 1.844, 1.695, 1.611, 1.545, and 1.493, respectively. - _Stanislav Sykora_, Dec 09 2015
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H J. S. Kimberley, <a href="/A006450/b006450.txt">Table of n, a(n) for n = 1..100000</a>
%H R. G. Batchko, <a href="http://arxiv.org/abs/1405.2900">A prime fractal and global quasi-self-similar structure in the distribution of prime-indexed primes</a>, arXiv preprint arXiv:1405.2900 [math.GM], 2014.
%H Jonathan Bayless, Dominic Klyve, and Tomás Oliveira e Silva, <a href="http://www.emis.de/journals/INTEGERS/papers/n43/n43.Abstract.html">New Bounds and Computations on Prime-Indexed Primes</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 13, Paper A43, 2013.
%H K. A. Broughan and A. R. Barnett, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/Broughan/broughan16.html">On the subsequence of primes having prime subscripts</a>, JIS 12 (2009) 09.2.3.
%H Paul Cooijmans, <a href="http://web.archive.org/web/20050302171708/http://members.chello.nl/p.cooijmans/gliaweb/tests/num.html">Numbers</a>.
%H Paul Cooijmans, <a href="http://web.archive.org/web/20031006141136/http://members.chello.nl/p.cooijmans/gliaweb/tests/tfg/tfgshort.html">Short Test For Genius</a>.
%H R. E. Dressler and S. T. Parker, <a href="http://dx.doi.org/10.1145/321892.321900">Primes with a prime subscript</a>, J. ACM 22 (1975) 380-381.
%H N. Fernandez, <a href="http://www.borve.org/primeness/FOP.html">An order of primeness, F(p)</a>
%H N. Fernandez, <a href="/A006450/a006450.html">An order of primeness</a> [cached copy, included with permission of the author]
%H N. Fernandez, <a href="http://www.borve.org/primeness/moreterms.html">More terms of this and other sequences related to A049076.</a>
%H A. B. Frizell, <a href="http://dx.doi.org/10.1090/S0002-9904-1915-02722-9">The permutations of the natural numbers can not be well ordered</a>, Bull. Amer. Math. Soc. 22 (1915), no. 2, 71-73.
%H Ernest G. Hibbs, <a href="https://www.proquest.com/openview/4012f0286b785cd732c78eb0fc6fce80">Component Interactions of the Prime Numbers</a>, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
%H Michael P. May, <a href="https://doi.org/10.35834/2020/3202158">Properties of Higher-Order Prime Number Sequences</a>, Missouri J. Math. Sci. (2020) Vol. 32, No. 2, 158-170; and <a href="https://arxiv.org/abs/2108.04662">arXiv version</a>, arXiv:2108.04662 [math.NT], 2021.
%H Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [Of] Integer Sequences And Pairing Functions</a>, arXiv preprint arXiv:1212.2732 [math.CO], 2012.
%H J. Shallit, <a href="/A006449/a006449.pdf">Letter to N. J. A. Sloane, Oct. 1975</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeFormulas.html">Prime formulas</a>, see Cipolla formula.
%F a(n) = prime(prime(n)) = A000040(A000040(n)). - _Juri-Stepan Gerasimov_, Sep 24 2009
%F a(n) > n*(log(n))^2, as prime(n) > n*log(n) by Rosser's theorem. - _Jonathan Sondow_, Jul 11 2012
%F a(n)/log(a(n)) ~ prime(n). - _Thomas Ordowski_, Mar 30 2015
%F Sum_{n>=1} 1/a(n) is in the interval (1.04299, 1.04365) (Bayless et al., 2013). - _Amiram Eldar_, Oct 15 2020
%e a(5) = 31 because a(5) = p(p(5)) = p(11) = 31.
%p seq(ithprime(ithprime(i)),i=1..50); # Uli Baum (Uli_Baum(AT)gmx.de), Sep 05 2007
%p # For Maple code for the prime/nonprime compound sequences (listed in cross-references) see A003622. - _N. J. A. Sloane_, Mar 30 2016
%t Table[ Prime[ Prime[ n ] ], {n, 100} ]
%o (Magma) [ NthPrime(NthPrime(n)): n in [1..51] ]; // _Jason Kimberley_, Apr 02 2010
%o (PARI) i=0;forprime(p=2,1e4,if(isprime(i++),print1(p", "))) \\ _Charles R Greathouse IV_, Jun 10 2011
%o (PARI) a=vector(10^3,n,prime(prime(n))) \\ _Stanislav Sykora_, Dec 09 2015
%o (Haskell)
%o a006450 = a000040 . a000040
%o a006450_list = map a000040 a000040_list
%o -- _Reinhard Zumkeller_, Jan 12 2013
%o (Python)
%o from sympy import prime
%o def a(n): return prime(prime(n))
%o print([a(n) for n in range(1, 52)]) # _Michael S. Branicky_, Aug 11 2021
%o (Python) # much faster version for initial segment of sequence
%o from sympy import nextprime, isprime
%o def aupton(terms):
%o alst, p, pi = [], 2, 1
%o while len(alst) < terms:
%o if isprime(pi): alst.append(p)
%o p, pi = nextprime(p), pi+1
%o return alst
%o print(aupton(10000)) # _Michael S. Branicky_, Aug 11 2021
%Y Primes for which A049076 > 1.
%Y Cf. A000040, A007821, A038580, A049090, A049202, A049203, A057847, A057849, A057850, A057851, A058332, A093047.
%Y Cf. A185723 and A214296 for numbers and primes that are sums of distinct a(n); cf. A213356 and A185724 for those that are not.
%Y 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 easy,nice,nonn
%O 1,1
%A _Jeffrey Shallit_, Nov 25 1975