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.

A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).

This page as a plain text file.
%I A014689 #59 Jul 05 2025 16:17:48
%S A014689 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,
%T A014689 75,76,79,80,83,96,99,104,105,114,115,120,125,128,133,138,139,148,149,
%U A014689 152,153,164,175,178,179,182,187,188,197,202,207,212,213,218,221,222
%N A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).
%C A014689 a(n) = A048864(A000040(n)) = number of nonprimes in RRS of n-th prime. - _Labos Elemer_, Oct 10 2002
%C A014689 A000040 - A014689 = A000027; in other words, the sequence of natural numbers subtracted from the prime sequence produces A014689. - _Enoch Haga_, May 25 2009
%C A014689 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
%C A014689 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
%C A014689 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
%C A014689 First differences are A046933 = differences minus one between successive primes. - _Gus Wiseman_, Jan 18 2020
%H A014689 T. D. Noe, <a href="/A014689/b014689.txt">Table of n, a(n) for n=1..1000</a>
%F A014689 G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - _Mario C. Enriquez_, Dec 13 2016
%t A014689 Table[Prime[n] - n, {n, 61}] (* _Alonso del Arte_ *)
%o A014689 (PARI) a(n) = prime(n)-n \\ _Charles R Greathouse IV_, Sep 05 2011
%o A014689 (Haskell)
%o A014689 a014689 n = a000040 n - fromIntegral n
%o A014689 -- _Reinhard Zumkeller_, Apr 09 2012
%o A014689 (Magma) [NthPrime(n)-n: n in [1..70]]; // _Vincenzo Librandi_, Mar 20 2013
%o A014689 (Python)
%o A014689 from sympy import prime
%o A014689 def A014689(n): return prime(n)-n # _Chai Wah Wu_, Oct 11 2024
%Y A014689 Equals A014692 - 1.
%Y A014689 Cf. A000040, A033286, A158611, A002808, A065890.
%Y A014689 Cf. A232463, A232443.
%Y A014689 The sum of prime factors of n is A001414(n).
%Y A014689 The sum of prime indices of n is A056239(n).
%Y A014689 Their difference is A331415(n).
%Y A014689 Cf. A000720, A046933, A056239, A318995, A325036, A331380, A331416, A331418.
%K A014689 nonn,easy,nice
%O A014689 1,3
%A A014689 _Mohammad K. Azarian_
%E A014689 More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
%E A014689 Correction for Aug 2009 change of offset in A158611 and A008578 by _Jaroslav Krizek_, Jan 27 2010