OFFSET
1,1
COMMENTS
Also, number of primes between prime(n) and prime(prime(n)) inclusive. For example, prime(1) = 2, prime(prime(1)) = prime(2) = 3 and there are two primes between 2 and 3 inclusive. - Zak Seidov, Sep 22 2003; N. J. A. Sloane, Mar 07 2007
Since a(n+1) - a(n) = prime(n+1) - prime(n) - 1 >= 1 for n > 1, the sequence is monotonic for n > 1. - N. J. A. Sloane, Mar 07 2007
a(n) = number of terms < prime(n) in A141468. - David James Sycamore, Oct 14 2017
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
MAPLE
MATHEMATICA
Table[Prime[n] - n + 1, {n, 61}] (* Geoffrey Critzer, May 02 2013 *)
PROG
(PARI) first(n) = {my(t, res = vector(n)); forprime(p=2, , t++; res[t] = p - t + 1; if(t>=n, return(res)))} \\ David A. Corneth, Oct 04 2017
(PARI) a(n) = prime(n)-n+1; \\ Altug Alkan, Oct 05 2017
(Python)
from sympy import prime
def A014692(n): return prime(n)-n+1 # Chai Wah Wu, Oct 11 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Andrew J. Gacek (andrew(AT)dgi.net)
STATUS
approved