OFFSET
1,3
COMMENTS
A000040 - A014689 = A000027; in other words, the sequence of natural numbers subtracted from the prime sequence produces A014689. - Enoch Haga, May 25 2009
a(n) = A000040(n) - n. a(n) = inverse (frequency distribution) sequence of A073425(n), i.e., number of terms of sequence A073425(n) less than n. a(n) = A065890(n) + 1, for n >= 1. a(n) - 1 = A065890(n) = the number of composite numbers, i.e., (A002808) less than n-th primes, (i.e., < A000040(n)). - Jaroslav Krizek, Jun 27 2009
a(n) = A162177(n+1) + 1, for n >= 1. a(n) - 1 = A162177(n+1) = the number of composite numbers, i.e., (A002808) less than (n+1)-th number of set {1, primes}, (i.e., < A008578(n+1)). - Jaroslav Krizek, Jun 28 2009
Conjecture: Each residue class contains infinitely many terms of this sequence. Similarly, for any integers m > 0 and r, we have prime(n) + n == r (mod m) for infinitely many positive integers n. - Zhi-Wei Sun, Nov 25 2013
First differences are A046933 = differences minus one between successive primes. - Gus Wiseman, Jan 18 2020
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
FORMULA
G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016
MATHEMATICA
Table[Prime[n] - n, {n, 61}] (* Alonso del Arte *)
PROG
(PARI) a(n) = prime(n)-n \\ Charles R Greathouse IV, Sep 05 2011
(Haskell)
a014689 n = a000040 n - fromIntegral n
-- Reinhard Zumkeller, Apr 09 2012
(Magma) [NthPrime(n)-n: n in [1..70]]; // Vincenzo Librandi, Mar 20 2013
(Python)
from sympy import prime
def A014689(n): return prime(n)-n # Chai Wah Wu, Oct 11 2024
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from Vasiliy Danilov (danilovv(AT)usa.net), July 1998
STATUS
approved