OFFSET
1,1
LINKS
Piotr Miska and János T. Tóth, On interesting subsequences of the sequence of primes, arXiv:1908.10421 [math.NT], 2019. See DiagP.
Błażej Żmija, A note on primes with prime indices, arXiv:1909.12139 [math.NT], 2019.
EXAMPLE
a(3) is 31 because the third prime is 5, the fifth prime is 11 and for the 3rd iteration, the eleventh prime is 31.
To get a(4): 4 -> 7 -> 17 -> 59 -> 277.
MAPLE
a:= n-> (ithprime@@n)(n):
seq(a(n), n=1..8); # Alois P. Heinz, Jun 21 2019
MATHEMATICA
Table[ Nest[ Prime, n, n ], {n, 1, 11} ]
PROG
(PARI) a(n) = my(k = n); for (j=1, n, k = prime(k); ); k; \\ Michel Marcus, Jan 01 2017
(Python)
from sympy import prime
def A058009(n):
k = n
for _ in range(n):
k = prime(k)
return k # Chai Wah Wu, Apr 06 2021
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Robert G. Wilson v, Nov 13 2000
EXTENSIONS
Edited by N. J. A. Sloane, Oct 30 2008 at the suggestion of R. J. Mathar
a(12)-a(13) from Donovan Johnson, Feb 17 2011
a(14) from Giovanni Resta, Sep 29 2019
a(13) corrected by Daniel Suteu, Jun 20 2021
STATUS
approved