A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).
1, 1, 2, 3, 6, 7, 10, 11, 14, 19, 20, 25, 28, 29, 32, 37, 42, 43, 48, 51, 52, 57, 60, 65, 72, 75, 76, 79, 80, 83, 96, 99, 104, 105, 114, 115, 120, 125, 128, 133, 138, 139, 148, 149, 152, 153, 164, 175, 178, 179, 182, 187, 188, 197, 202, 207, 212, 213, 218, 221, 222
Offset: 1
Links
- T. D. Noe, Table of n, a(n) for n=1..1000
Crossrefs
Programs
-
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
-
Mathematica
Table[Prime[n] - n, {n, 61}] (* Alonso del Arte *)
-
PARI
a(n) = prime(n)-n \\ Charles R Greathouse IV, Sep 05 2011
-
Python
from sympy import prime def A014689(n): return prime(n)-n # Chai Wah Wu, Oct 11 2024
Formula
G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016
Extensions
More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
Comments