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.

A058009 a(n) is obtained by applying the map k -> prime(k) n times, starting at n.

Original entry on oeis.org

2, 5, 31, 277, 5381, 87803, 2269733, 50728129, 1559861749, 64988430769, 2428095424619, 119543903707171, 5519908106212193, 248761474969923757
Offset: 1

Views

Author

Robert G. Wilson v, Nov 13 2000

Keywords

Examples

			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.
		

Crossrefs

For composites, see A280327. - Matthew Campbell, Jan 01 2017

Programs

  • 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} ]
  • 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

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