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.

A014692 a(n) = prime(n) - (n-1).

This page as a plain text file.
%I A014692 #58 Oct 12 2024 09:07:37
%S A014692 2,2,3,4,7,8,11,12,15,20,21,26,29,30,33,38,43,44,49,52,53,58,61,66,73,
%T A014692 76,77,80,81,84,97,100,105,106,115,116,121,126,129,134,139,140,149,
%U A014692 150,153,154,165,176,179,180,183,188,189,198,203,208,213,214,219,222,223
%N A014692 a(n) = prime(n) - (n-1).
%C A014692 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
%C A014692 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
%C A014692 a(n) = number of terms < prime(n) in A141468. - _David James Sycamore_, Oct 14 2017
%H A014692 David A. Corneth, <a href="/A014692/b014692.txt">Table of n, a(n) for n = 1..10000</a>
%p A014692 A014692:=n->ithprime(n)-(n-1): seq(A014692(n), n=1..100); # _Wesley Ivan Hurt_, Oct 15 2017
%t A014692 Table[Prime[n] - n + 1, {n, 61}]  (* _Geoffrey Critzer_, May 02 2013 *)
%o A014692 (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
%o A014692 (PARI) a(n) = prime(n)-n+1; \\ _Altug Alkan_, Oct 05 2017
%o A014692 (Python)
%o A014692 from sympy import prime
%o A014692 def A014692(n): return prime(n)-n+1 # _Chai Wah Wu_, Oct 11 2024
%Y A014692 Cf. A000040, A141468.
%Y A014692 Equals A014689 + 1.
%K A014692 nonn,easy
%O A014692 1,1
%A A014692 _Mohammad K. Azarian_
%E A014692 More terms from Andrew J. Gacek (andrew(AT)dgi.net)