OFFSET
1,1
COMMENTS
With prepended a(0) = 1 this is the lexicographically earliest infinite sequence such that A056239(a(n)) = a(n-1) + A056239(a(n-1)). - Antti Karttunen, Nov 02 2024
FORMULA
a(n) = prime(pi(a(n-1)) + a(n-1)). - Vladeta Jovovic, Jun 19 2004
a(1)=2, a(n) = next a(n-1)th prime after a(n-1). - Zak Seidov, Mar 21 2009
EXAMPLE
19 follows 5 as there are 5 primes > 5 and up to 19 inclusive, (7,11,13,17,19).
MATHEMATICA
a[1] := 2; a[n_] := Prime[PrimePi[a[n - 1]] + a[n - 1]]; Table[a[n], {n, 1, 10}] (* Stefan Steinerberger, Apr 10 2006 *)
NestList[Prime[PrimePi[ # ] + # ] &, 2, 13] (* Zak Seidov, Mar 21 2009 *)
PROG
(Python)
from sympy import prime
p, q = 2, 1
A093502_list = [p]
for _ in range(15):
r = p + q
p, q = prime(r), r
A093502_list.append(p) # Chai Wah Wu, Jun 17 2019
CROSSREFS
KEYWORD
more,nonn,changed
AUTHOR
Amarnath Murthy, Apr 17 2004
EXTENSIONS
a(10) from Vladeta Jovovic, Jun 19 2004
More terms from Stefan Steinerberger, Apr 10 2006
a(13) from Zak Seidov, Mar 21 2009
a(14)-a(15) from Donovan Johnson, Dec 08 2009
Better definition from Jon E. Schoenfield, Aug 22 2017
a(16) from Chai Wah Wu, Jun 17 2019
STATUS
approved